Error: Database already open

  • Thread starter Thread starter zeeshanh
  • Start date Start date
Z

zeeshanh

Guest
hi
i get the error "The database is already opened exclisively by another user" after running the following code. i ran the same code under the same conditions on my home pc and it worked fine.

Code:
Private Sub Command1_Click()

Dim dbs As Database
Dim qdf As QueryDef
Dim strSQL As String

Set dbs = CurrentDb
strSQL = "update Emp set Salary = 786+ val(text2)- val(text3) where EmpID = '& val(text1) &'"
Set qdf = dbs.CreateQueryDef("", strSQL)

End Sub
 
Check if there's a form with same source as your SQL query that has Record Locks property set to All or Edited. That will lock your table exclusively to that form.
Helped me when I experienced a similar problem ... ;)
 

Users who are viewing this thread

Back
Top Bottom