I'm using Access 2013 as a front end with a SQL Server back end, and I'm trying to bind an ADO Recordset to a form, however, the Recordset will only open as Static. So I can see all the records in a datasheet, I just can't edit them.
I can use the connection object to execute an update query, so I don't think that is the issue. I've tried using Dynamic, Keyset and Forward-Only and locking as Batch Optimistic, Optimistic, and Pessimistic to open the Recordset, but still opens as static.
Below code is condensed, but essentially the same, and most importantly, still doesn't work.
Public Sub TestConnect()
Dim objConn As ADODB.Connection
Dim objRS As ADODB.Recordset
Set objConn = New ADODB.Connection
objConn.ConnectionString = "Data Provider=sqloledb;Provider=Microsoft.Access.OLEDB.10.0;Server=REDACTED;Database=REDACTED;Trusted_Connection=Yes"
objConn.CursorLocation = adUseClient
objConn.Open
Debug.Print objConn.state = adStateOpen
Set objRS = New ADODB.Recordset
objRS.CursorLocation = adUseClient
objRS.Open "SELECT * FROM Table1;", objConn, adOpenDynamic, adLockOptimistic
Debug.Print objRS.CursorType
objRS.Close
objConn.Close
End Sub
I've tried looking at a few place, such as https://learn.microsoft.com/en-us/office/vba/access/Concepts/ActiveX-Data-Objects/bind-a-form-to-an-ado-recordset and MS Access Form Bound to ADO Disconnected Recordset, but I'm not having any luck identifying where my issue is.
Any help would be amazing, I'm tearing my hair out here. Thanks!