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:
  1. Private Sub Command116_Click()
  2.    Dim CurConn As New ADODB.Connection
  3. Dim rst As New ADODB.Recordset, rstCln As New ADODB.Recordset
  4. Dim CurDB As Database
  5. Set CurDB = CurrentDb
  6. Set CurConn = New ADODB.Connection
  7. With CurConn
  8. .Provider = "Microsoft.Jet.OLEDB.4.0"
  9. .ConnectionString = "data source= " & CurDB.Name
  10. .Open
  11. End With
  12.   Set rst = New ADODB.Recordset
  13. rst.CursorType = adOpenKeyset
  14. rst.LockType = adLockOptimistic
  15. rst.Open "SELECT * FROM equips WHERE [Village name] = '" & Me![Village name] & "'", CurConn, , , adCmdText
  16. End sub