Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2006
    Posts
    60

    Unanswered: Open A Database That Is Locked By Another User

    I have a shared database and sometimes, somehow it gets locked by a user. when someone else tries to open the database it gets the message "Database is locked by user on [COMPUTERNAME]" or something like that

    is there a way i can make some code occur at this stage, like make a msg box appear stating how the user can fix it or something. sort of like an On Load error thing, but will it get it in that far cause its not opening the database at all. can anyone help me here

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Are multiple users opening the same file? If so, you'd be far better off making the file available to users locally on there workstation (keeping just the data on the network).

    tc

  3. #3
    Join Date
    Feb 2006
    Posts
    60
    yes multiple users are opening the same file shared on the server (the front end). i know i could put the front end on every users machine but it would be hard for me to make sure everyone is using the latest version. im probably gonna put it on every machine but if i can do this it would help with other things, like if the front end crashes and it needs to be repaired, they may not know why or what to do and if i could load some code i could make it better.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    another technique is to deploy your front end as an MDE, which takes away any design rights , so its less liklely you will get the locked message, it usually means that soemone has openend the file in exclusive mode, or soemone has started tinkering with a form or report.

    if your users are allowed to make changes to forms or reports then they must have a local front end.

    if you users don't need to make changes (and in most cases I'd say this is preferred, improves developer sanity) then it can be deployed as an MDE front end on the server, although with nmore users it can make sense to redeploy. I haev heard comments that the more users using the same physical access file the more likely yu are to get corruption, not seen it myself. A word of caution if you do deploy as an MDE make sure you keep your development model (MDB) its very difficult to get anything meaningfull from an MDE escpecially when the customer demnads a minor change right now.

    HTH
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    A distribution trick I came up with a while back:

    I have a small EXE file that goes out to the network and copies the front end to the user's local temp directory and then runs it from there.

    There's other stuff my EXE does too (like verify the user actually has Access installed), but the premise is the same.

    This way, there's never anybody actually in the network version and posting updates is now a snap: update the file and every user is updated the next time they run it.

    btw: Your users will probably see a performance improvement when they run the FE from their local machine.

    tc

  6. #6
    Join Date
    Dec 2004
    Location
    Connecticut
    Posts
    85
    Months ago, I found a bunch of threads here addressing the problem of keeping the Front End on workstations up-to-date. There were some cool executables that checked versions and replaced the front end as needed.

    The trick that worked best for us was to put a copy of the latest FE in the same shared folder with the back end and use a batch file to copy the FE to the workstation and launch it with access, in place of the usual shortcut to the FE. Our FE was pretty small and our network had lots of bandwidth to spare, so that may not be best for you. All the user saw was a shortcut that launched the database.

  7. #7
    Join Date
    Feb 2006
    Posts
    60
    ok, thanks for the info. i was actually thinking about running a batch file to copy it to the local machine.

    cheers

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Easy way to clone the front end with the users login name

    Here's an easy way to clone the front end make a new mdb with the user's login name and then open that file. You may have to do something with linking the tables if they are access tables but this works great if you are using SQL Server or MySQL linked tables. It's also an easy way to see if that user in is the mde (you'll see a TimeSheetUSERX.ldb file) and you can also look at the size of their mde and see if they opened the latest version. And lastly, you can copy new mde code without making all the users close out to copy it (just tell them to close out and get back in when they have a chance to).

    Edit the attached vbs script in the zip file so it points to the mde/mdb file you are cloning and make sure the user's run the vbs script instead of the mde/mdb file.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Feb 2006
    Posts
    60
    i finished this system. i have a shortcut on the desktop, which runs the batch file (below quote). it copies the folder from the server (on a mapped drive all users have) which has all pics in it etc i require (so it gets them from C:\ not from server). copys the folder to C:\ and then opens it. really simple, very effective.

    @echo off

    xcopy "J:\QA\Job Manager" "C:\Job Manager" /Y /I /Q
    start "Job Manager.mdb" "C:\Job Manager\Job Manager.mdb"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •