Results 1 to 2 of 2

Thread: Any way to quickly switch user in user-level security ?

  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    Any way to quickly switch user in user-level security ?

    I'm looking for a way to quickly switch user for a user-level secured .mdb, since it's going to be accessed on promiscuous computers by multiple operators. A close and restart function would be good enough, but the only one I have found doesn't support user-level protection :

    http://blog.nkadesign.com/2008/ms-ac...grammatically/

    Any other solution/shortcut ?
    Thx

  2. #2
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    A little step forward !
    I have placed a button on my form that OnClick launches an external restart.vbs file
    The code for the restart.vbs file is as follows

    Code:
    dim accessApp
    set accessApp = GetObject("G:\Database\MyDatabase.mdb")
    accessApp.CloseCurrentDatabase
    WScript.sleep 20000
    accessApp.OpenCurrentDatabase("G:\Database\MyDatabase.mdb")
    My trouble is that at restart the database is automatically re-opened using the same username and password : since my original purpose was switching the user, you can figure out how disturbing it is.
    The only way to me to be reprompted for a new username and password is to use :

    Code:
    accessApp.quit
    instead of

    Code:
    accessApp.CloseCurrentDatabase
    ... but this means you have to quit and restart the whole application (Access), not just the database (=more time needed).
    Further, I have noticed that the ... :

    Code:
    accessApp.CloseCurrentDatabase
    .... code deletes the .ldb file but not the .ldw file, so that's likely the reason for the fault.
    The .ldb file, opened in notepad shows myself as the connected user, but the database is actually closed and no other user is connected !!! I have tried to remove the

    accessApp.OpenCurrentDatabase("G:\Database\MyDatab ase.mdb")

    code so that the .vbs was close-only, and also in this case the .ldb remained there. So it seems as a fault of the CloseCurrentDatabase function.
    As you can see above I have also tried to add a long pause in the .vbs hoping this was enough for the .ldb to self-delete, but this didn't help.
    How can I delete that f****d .ldb file ????

Please reply to this thread with any new information or opinions.

Similar Threads

  1. User Level Security eliminated?
    By mjhopler in forum Security
    Replies: 6
    Last Post: 09-29-2011, 04:14 PM
  2. Get User Automatically and Security Level example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-23-2010, 10:47 PM
  3. Replies: 8
    Last Post: 06-30-2010, 09:57 PM
  4. user level security and splitting access db
    By tomClark in forum Security
    Replies: 3
    Last Post: 02-06-2010, 02:28 PM
  5. User level security question
    By genesis in forum Security
    Replies: 1
    Last Post: 07-08-2009, 09:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums