I know someone has done this before... 
Author Message
 I know someone has done this before...

When the user opens the database, I want to check if they have it opened
exclusively in code and display a message.  Anyone done this before?

Jeff

(sorry, brain not functioning today...)



Fri, 03 Dec 1999 03:00:00 GMT  
 I know someone has done this before...

Quote:

> When the user opens the database, I want to check if they have it opened exclusively in code and display a message.  Anyone done this before?

In access 2.0, I use this bit of code, created in a module:

Function Check_Shared ()
    Dim X As Variant
    X = Application.GetOption("Default Open Mode for Databases")
    If X = 1 Then
        MsgBox "Please open this application in shared mode.", ,
GetDatabaseName()
        Application.SetOption "Default Open Mode for Databases", 0
        DoCmd Quit
    End If

End Function

This code also, if they are opening the database exclusively, sets
Access to default to opening a database shared, and then throws them out
of the database. (They have to relog in to make the shared access work.
Every future time they try to open the database with the same computer,
however, it will work first time.)

I then run this code in the AutoExec macro for the database. If you have
people that commonly bypass the AutoExec, then you could put the
function in On_open of every form, if need be.

Sarah Heacock



Fri, 03 Dec 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ** Hope someone know how to send a Querystrig, having alot of problems with this

2. I'm having a problem using the MSComm control I hope someone can help

3. Could someone give me an idea about doing VB and Oracle

4. Outlook Send/Receive - Someone knows the answer

5. I know I'm cheating, but can someone help

6. Someone must know the answer???

7. Please someone must know this !!! =(

8. Please someone must know this!!!

9. please, someone must know this

10. Need someone who knows Applesoft Basic & qbasic

11. Does someone know a really nice way of using Scroll Bars

12. Someone out there has to know this....

 

 
Powered by phpBB® Forum Software