General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
Problem updating records using ADO on an Access database
I am receiving an error 3251 "This operation is not supported by this provider" when I am simply trying to move data from a textbox control to a recordset field for updating. I am new to ADO and don't understand where I am going wrong. The following is the code that I am using
Private Sub Form_Load()
Set cntPORequest = New ADODB.Connection
Set rstGroups = New ADODB.Recordset
cntPORequest.Mode = adModeReadWrite
cntPORequest.Provider = "MSDASQL"
cntPORequest.ConnectionString = "PORequest"
cntPORequest.CursorLocation = adUseClient
cntPORequest.Open
rstGroups.ActiveConnection = cntPORequest
rstGroups.CursorType = adOpenKeyset
rstGroups.LockType = adLockOptimistic
rstGroups.Source = "tblGroup"
rstGroups.Open
End Sub
I use the following two lines of code to find a specific record for editing.
strCmd = "Select * From tblGroup Where tblGroup.GroupName = '" & bGroups.Text & "'"
Set rstGroups = cntPORequest.Execute(strCmd)
<<< The error occurs on anyone of these lines when moving the changes>>>
Private Sub MoveDataToRecord()
rstGroups!GroupLeader = tbGroupLeader
rstGroups!GroupName = tbGroupName
rstGroups!Login = tbLogin
rstGroups!Password = tbPassword
End Sub
Can anyone please help?
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only