PC Review


Reply
Thread Tools Rate Thread

How do I lock out users if am in the database in Access?

 
 
=?Utf-8?B?U2NodWxmZXI=?=
Guest
Posts: n/a
 
      6th Sep 2006
I am trying to keep other backend users out of the database once I enter it.
Is thier a way of doing this.
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      6th Sep 2006
Schulfer wrote:
> I am trying to keep other backend users out of the database once I
> enter it. Is thier a way of doing this.


Open it exclusively. It's an option in the file open dialog.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      6th Sep 2006
To open the back end exclusively in code from the front end put a module
along these lines in the front end:

''''module begins''''
Option Compare Database
Option Explicit

Dim dbs As DAO.Database
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub LockBackend(strPath As String)

On Error GoTo Err_Handler

Set dbs = OpenDatabase(strPath, True)

Exit_Here:
Set dbs = Nothing
Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error"
Resume Exit_Here

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub UnlockBackEnd()

On Error GoTo Err_Handler

Const NO_REF_TO_BACKEND = 91

'On error resume next
dbs.Close

Exit_here:
Set dbs = Nothing
Exit Sub

Err_Handler:
Select Case Err.Number
Case NO_REF_TO_BACKEND
' do nothing
Case Else
' unknown error
MsgBox Err.Description, vbExclamation, "Error"
End Select
Resume Exit_here

End Sub
''''module ends

Ken Sheridan
Stafford, England

To 'lock' the back end, which you can either do when the front end starts up
or whenever you want to edit data, e.g. when a bound form is opened, call the
LockBackEnd procedure, passing the path to the back end into it:

LockBackEnd "F:\SomeFolder\SomeSubFolder\SomeDatabase.mdb"

to unlock it call the UnlockBackEnd procedure:

UnlockbackEnd

"Schulfer" wrote:

> I am trying to keep other backend users out of the database once I enter it.
> Is thier a way of doing this.


 
Reply With Quote
 
CompGeek78
Guest
Posts: n/a
 
      6th Sep 2006
Just to add more specific instructions.

Open Access
Go to the File menu, Choose Open
Find and SINGLE click the file you want to open
On the right side of the open button at the bottom right, there is a
small down arrow. Click the down arrow, not the word "Open".
Choose open exclusive.

Keven

Rick Brandt wrote:
> Schulfer wrote:
> > I am trying to keep other backend users out of the database once I
> > enter it. Is thier a way of doing this.

>
> Open it exclusively. It's an option in the file open dialog.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com


 
Reply With Quote
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      6th Sep 2006
PS: The commented out 'on error resume next' line in my reply was because I
first thought of using inline error handling, but then decided to branch to
an error handler instead. Omitted to delete the line.

Ken Sheridan
Staford, England

"Schulfer" wrote:

> I am trying to keep other backend users out of the database once I enter it.
> Is thier a way of doing this.

 
Reply With Quote
 
aaron.kempf@gmail.com
Guest
Posts: n/a
 
      7th Sep 2006
if you had enough balls to be using SQL Server; it would be quite easy.


you could merely kill connections lol

MDB is for babies.

Access Data Projects won the war.

-Aaron


Ken Sheridan wrote:
> PS: The commented out 'on error resume next' line in my reply was because I
> first thought of using inline error handling, but then decided to branch to
> an error handler instead. Omitted to delete the line.
>
> Ken Sheridan
> Staford, England
>
> "Schulfer" wrote:
>
> > I am trying to keep other backend users out of the database once I enter it.
> > Is thier a way of doing this.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 out of 17 users lock database using runtime =?Utf-8?B?Ulc=?= Microsoft Access Security 10 8th Jun 2005 02:42 PM
lock users from backend access Beth Microsoft Access Security 2 15th Apr 2004 03:53 PM
Lock users out of table, but still access data? Rick Microsoft Access Security 2 5th Feb 2004 10:03 PM
Can you Lock Down Internet Access to your users on Win9x? Jeff Rush Microsoft Windows 2000 Security 2 21st Oct 2003 07:41 PM
Access 2002 SP 2 "lock database from users' editing?" Jackson Vanderlinden Microsoft Access 1 17th Sep 2003 05:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:36 AM.