Opening MS Access Database from VB Used by Another User

Is there a way to open the MS Access database from VB 6.0, which is being used by another user.

I have a service that updates a .mdb file. I want to track this database, periodically reading some parameters from it.

If I try to just open the database (which works if the database is not in use), like this:

Private Sub Form_Load()
Dim CurrentDBFileName
On Error GoTo ErrorHandler
    Set BaseDB = OpenDatabase("c:\temp\log_db.mdb")
    Set DestRS = BaseDB.OpenRecordset("current_log_info", dbOpenDynaset)
    DestRS.MoveFirst
    CurrentDBFileName = DestRS!CurrentDB
    BaseDB.Close
ErrorHandler:
    Debug.Print Err.Number; Err.Description
End Sub

The error I am getting is:

3051 The Microsoft Jet database engine cannot open the file 'b: \ log_db.mdb'. It is already open exclusively by another user, or you need permission to view its data.

How can I get around this?

I cannot change the service updating the MDB file, since it is not mine.

+3
2

Try:

Set BaseDB = OpenDatabase("gui_db.mdb", false)

. , .

+3

, - , , , .

mdb, , ( Access, SQL Server). , frontend , - . .

0

Source: https://habr.com/ru/post/1713161/


All Articles