Read-only problem when binding a form to an ADO record source

L

LW

I'm trying to get around a "Form is read-only" error when I bind a form to an
ADO recordset. I've followed the problem resolution as described in
KB227053, but still get the error. The data loads, but I can't edit it.
Here's my code. Anyone run into this before?

Private Sub Form_Open(Cancel As Integer)
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cnn = New ADODB.Connection
With cnn
.Provider = "MSDataShape"
.ConnectionString = "File Name=E:\data\rcff.UDL"
.CursorLocation = adUseServer
.Open
End With
Set rs = New ADODB.Recordset
with rs
.Source = "SELECT * FROM test"
.ActiveConnection = cnn
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open
end with
Set Me.Recordset = rs
End Sub

Also, I've tried to specify me.uniquetable="test", but that gives me an
error 2101.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top