Opening a MS Access database from VB that is being used by another user

Opening a MS Access database from VB that is being used by another user

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

I have a service that is updating a .mdb file. I want to monitor this DB by reading some parameters from it periodically.

If I try to simply open the DB (which works if the DB is not used) 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 get:

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

How can I get around this?

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

Unique Constraint on two fields and their reverse


Copy records from two database in sqlite
Postgresql one db with multiple schemas vs multiple db with one schema
Set BaseDB = OpenDatabase("gui_db.mdb", false) 
To open the database in shared mode.

How to store and compress data for real time data logging?
Note that all clients must open the database in shared mode..
Storing R Objects in a relational database

When scraping a lot of stats from a webpage, how often should I insert the collected results in my DB?

Inserting rows in table that has a relationship with another table


Web scripting language with parallel non blocking database access?
Of course, the best option is to convince the person who wrote the updater service that it should really open the database in shared mode, not exclusive mode.. Another option might be to split the mdb table you want to update out into a separate backend (either another Access database, or SQL Server).

Then if the service opens the frontend file exclusively, your backend file should still be shared.

The updater service shouldn't be able to see the difference..

80 out of 100 based on 60 user ratings 710 reviews