Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
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?
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement