Guys i always get an error in this...it says "Syntax error in Update Statement"
please help...
Sub updateaccount(ByVal Username As String, ByVal Password As String, ByVal FName As String, ByVal MName As String, ByVal LName As String, ByVal Restrict As String, ByVal FullName As String)
connect = New ADODB.Connection
rs = New ADODB.Recordset
Dim rss As New ADODB.Recordset
connect.ConnectionString = "PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source=C:\Users\Spongebob\Desktop\DataBase1.mdb"
connect.Open()
Dim sql1, sql As String
sql = "Select AUsername from AdminAccount"
rs.Open(sql, connect, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockPessimistic)
If Username = "" Or Password = "" Or FName = "" Or MName = "" Or LName = "" Then
MsgBox("Input asked values.")
Else
sql1 = "UPDATE AdminAccount where (AUsername = '" & Trim(Username) & "') set (APassword = '" & Trim(Password) & "', AFName ='" & Trim(FName) & "', AMName ='" & Trim(MName) & "', ALName ='" & Trim(LName) & "', Restrict? ='" & Trim(Restrict) & "', AFullName ='" & Trim(FullName) & "')"
rss.Open(sql1, connect, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockPessimistic)
MsgBox("Change(s) of the Account " & Username & " was saved!")
End If
End Sub