setting the recordset in code

J

Jake

I am trying to set a recordset programtically referring to a remote SQL server.

I have been sucessfull in setting the recordset but it does not apear to be
updatable. Is it posible to make a dynamic recordset that is updatable?

I am using the method descibed in the Access VBA help files which looks like
this:

Global rstSuppliers As ADODB.Recordset
Sub MakeRW()
DoCmd.OpenForm "Suppliers"
Set rstSuppliers = New ADODB.Recordset
rstSuppliers.CursorLocation = adUseClient
rstSuppliers.Open "Select * From Suppliers", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Forms("Suppliers").Recordset = rstSuppliers
End Sub

I have experemented with different cursorlocation and cursortype settings
with no success.
 
M

Maurice

Are you sure the table has a unique index? Without a key a table becomes
'not' updatetable...
 

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