hi,
when i try to run this code i get an error that says that "the database has been placed in a state by the user that does not allow it to be opened or locked."
what am i doing wrong? its my first time using ADO and i cant get pass this stage.
VB Code:
Private Sub Command116_Click() Dim CurConn As New ADODB.Connection Dim rst As New ADODB.Recordset, rstCln As New ADODB.Recordset Dim CurDB As Database Set CurDB = CurrentDb Set CurConn = New ADODB.Connection With CurConn .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionString = "data source= " & CurDB.Name .Open End With Set rst = New ADODB.Recordset rst.CursorType = adOpenKeyset rst.LockType = adLockOptimistic rst.Open "SELECT * FROM equips WHERE [Village name] = '" & Me![Village name] & "'", CurConn, , , adCmdText End sub




Reply With Quote