Expand|Select|Wrap|Line Numbers
- Dim cn As ADODB.Connection
- Dim rs As New ADODB.Recordset
- Dim strSQL As String
- Set cn = New ADODB.Connection
- With cn
- .Provider = "Microsoft.Jet.OLEDB.4.0"
- .Open "\\Computer1\Project\SampleDB.mdb"
- End With
- strSQL = "Update Users set Password='" & txtNewPwd.Text & "' where UserID=" & UserID
- cn.Execute strSQL
"cn.Execute strSQL" statement gives run-time error Message: "ErrorSyntax in Update".
But when i copy the query from VB(on debugging) and execute in MS Access it s geting executed.
What is the reason for this error ?