Locking Access DB

Locking Access DB

Post by Jarred Freema » Thu, 12 Jul 2001 23:58:17



How can I lock down an access database so that it will not
allow write access if someone else has it open?  Is there
VB code that can recognize at run-time if the database is
open?  (If daoControl.Open Then ...) Something like this,
although I know the .Open won't work.

Thanks,
JF

 
 
 

Locking Access DB

Post by Ed » Fri, 13 Jul 2001 00:53:04


----------------
On the connection object specify a mode
of "adModeShareDenyNone". If anyone else tries to open a
connection, they should get a open exclusive error.

ed.

Quote:>-----Original Message-----
>How can I lock down an access database so that it will
not
>allow write access if someone else has it open?  Is there
>VB code that can recognize at run-time if the database is
>open?  (If daoControl.Open Then ...) Something like this,
>although I know the .Open won't work.

>Thanks,
>JF
>.


 
 
 

Locking Access DB

Post by Ed » Fri, 13 Jul 2001 00:55:46


-----------------
sorry, my bust, i thought you were using ADO and after i
sent the response, i realized you were using DAO. I'll
have to look it up, but i bet you specify the open mode in
the opendatabase() function.

ed.
-----------------

Quote:>-----Original Message-----
>How can I lock down an access database so that it will
not
>allow write access if someone else has it open?  Is there
>VB code that can recognize at run-time if the database is
>open?  (If daoControl.Open Then ...) Something like this,
>although I know the .Open won't work.

>Thanks,
>JF
>.

 
 
 

Locking Access DB

Post by ed » Fri, 13 Jul 2001 01:04:20


------------------------
Looks like you have to specify the parameter in a
recordset object of the. The openrecordset() method has a
options parameter wher you can us "dbDenyRead" on the
recordset. This means that other users can't get to the
tables/fields specified in your recordset query, however,
they can get to other parts of your DB.

Hope this helps.
Ed.
--------------------

Quote:>-----Original Message-----
>How can I lock down an access database so that it will
not
>allow write access if someone else has it open?  Is there
>VB code that can recognize at run-time if the database is
>open?  (If daoControl.Open Then ...) Something like this,
>although I know the .Open won't work.

>Thanks,
>JF
>.

 
 
 

Locking Access DB

Post by Jarred Freema » Fri, 13 Jul 2001 02:43:35


adModeShareDenyNone won't work with a DAO connection.  I
would use ADO but it does not have some of the
functionality that I like in DAO.

Quote:>-----Original Message-----
>----------------
>On the connection object specify a mode
>of "adModeShareDenyNone". If anyone else tries to open a
>connection, they should get a open exclusive error.

>ed.

>>-----Original Message-----
>>How can I lock down an access database so that it will
>not
>>allow write access if someone else has it open?  Is
there
>>VB code that can recognize at run-time if the database
is
>>open?  (If daoControl.Open Then ...) Something like
this,
>>although I know the .Open won't work.

>>Thanks,
>>JF
>>.

>.

 
 
 

1. I need to alter a locked access db.

Hi. Good 'ol CF locks access dbs when it has been quired on for appx 2 hours
(depending on your sy admin's settings). I need to alter my db (add a
column), but I dont know the SQL syntax to execute the task. So I need to
know both A) How to unlock access from a remote location and B) how to use
the ALTER TABLE command under Access.

2. Multi Machine how to Acess and lock the same database ( No use the Server database)

3. openin locked access db

4. IN-Oracle DBA

5. Record Locking Access DB with ADO

6. CONTRACT:Progress/Long term/Oh

7. HELP!! ADO FILTER BUG LOCKS ACCESS DB?

8. VB6 MTS dll locks up ASP db access after NT4 SP4 VI6 SP1

9. Multiuser Access 2000 DB using ADO - Locking Problem

10. locking a recordset in VB (ACCESS db )

11. Access DB on Web -- ERROR: Couldn't Lock file

12. Row level locking with an Access 97 DB ?