Hi!
I have been writing a VB desktop user program and website that are using an Access XP database. I recently ran in to problems with the database not being written to as it was already opened by someone else. My problem is the following; I need to be able to check to see if the database is opened by a different portion of the program before it attempts to write any changes. There are many functions/subroutines that use the database in both the website and desktop portions. Does anyone have any suggestions for how to check this status before the connection is opened? Thanks!
This is what I have so far, the problem is, I cannot access the function that called this code. (If this makes any sense, if not please let me know.)
-
Private Sub TestIfOpen()
-
If Len(Trim(Dir("Z:\prntaudit\tcsss\tcsss.ldb"))) > 0 Then
-
' Yup file is there
-
MessageBox.Show("Database is locked")
-
dbChkTmr.Enabled = True
-
intTmrChk = 0
-
Else
-
' No file
-
MessageBox.Show("Database is open")
-
If dbChkTmr.Enabled = True Then
-
dbChkTmr.Enabled = False
-
End If
-
End If
-
End Sub
-
Thanks!
Thomas