In addition to the above:
I said that I was using following code:
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
rs.Open "Select * from customers", "DSN=ADOTest", adOpenKeyset, adLockPessimistic
Set Adodc1.Recordset = rs
Adodc1.Caption = "Customers"
End Sub
However, sometimes when I save I get the following error:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
I have no idea what that error means. The error happens on the following line:
Adodc1.Recordset.Update
If I add the following details to the Adodc1 control and miss out the above code, I don't get the error:
CommandType 2 - adCmdTable
ConnectionString DSN=ADOTest
CursorType 1 - adOpenKeyset
LockType 2 - adLockPessimistic
RecordSource Customers
Any idea where I'm going wrong ? The code in Private Sub Form_Load() is from a MSFT Knowledge Base article, so I'm a bit confuse as to why it doesn't work.
Best.
Matt.