Database: MS Access 2003
I am trying to bind a form to an ado recordset, but having a little problem with the updating side of things. The fields populate ok, however when trying to update any of the data, I get the "This recordset is not updatable" message.
Here is my code:
Code:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
'Open connection to object
Set cn = New ADODB.Connection
With cn
.Provider = "MSDataShape"
.Properties("Data Provider").Value = "SQLOLEDB"
.Properties("Data Source").Value = "127.0.0.1" 'local loopback for now, until live.
.Properties("User ID").Value = "user"
.Properties("Password").Value = "pass"
.Properties("Initial Catalog").Value = "UsersDatabase"
.CursorLocation = adUseServer
.Open
End With
'Create instance of the recordset
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT tblUsers.* FROM tblUsers"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
End With
'Bind controls within the form to the ado recordset
Set Me.Recordset = rs
'Close the connections
rs.Close
cn.Close
I've a feeling one of the locks is not going server side, but dont know which :|
------------------------
Hit any User to continue