How to Get Exclusive Mode using DAO (1 Viewer)

jal

Registered User.
Local time
Yesterday, 19:45
Joined
Mar 30, 2007
Messages
1,709
I can't figure out how to open an .MDB file in exclusive mode using C#. For example I've tried this:

object oMissing = System.Reflection.Missing.Value;
DAO.DBEngine eng = new DAO.DBEngine();
DB = eng.OpenDatabase(pathToDB, oMissing, true,oMissing);
 

jal

Registered User.
Local time
Yesterday, 19:45
Joined
Mar 30, 2007
Messages
1,709
Microsoft says "To open a database by using exclusive access with DAO, set the Options argument of the OpenDatabase method to True."
http://msdn.microsoft.com/en-us/library/aa141813(office.10).aspx

But it doesn't seem to be working for me. I tried these ways:

DB = eng.OpenDatabase(pathToDB, true,oMissing, oMissing);
DB = eng.OpenDatabase(pathToDB, -1,oMissing, oMissing);
DB = eng.OpenDatabase(pathToDB, 1,oMissing, oMissing);


 

Users who are viewing this thread

Top Bottom