Re: Couldn't Lock File Error
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Fri, 17 Feb 2006 11:54:40 -0600
"C Holmes" <CHolmes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3E5E3E11-8D78-44B2-AA81-2C464A107500@xxxxxxxxxxxxxxxx
Good Morning All,error
I have a VB App which is deployed onto a number of client PC's. The app
connects to an Access database located on the network. On occassion the
"Couldn't lock file" is raised (Err.Num -2147467259). I assume that thisI've
would be related to 2 apps trying to hit the database at the same time. I
know that Access isn't the best option for this situation, but it's all
got at this time.same
I am trying to figure out the best way to handle this error.
I could have the program execute the statement again, but that just might
raise the same error again since they both initially started around the
time.the
Or should I try to have the app re-execute the statement, but first use
Sleep function to have the app wait a random amount of time so thathopefully
the 2 apps won't clash again. And then if that were to fail just throw upa
msgbox "Couldn't connect to database. Try again", and leave it up to theuser
to try again.
Appreciate any input and ideas.
Thanks.
[What follows is likely a highly unsatisfactory reply. <g>]
MSAccess is a file-based database. There is no central manager (database
server) and therefore is subject to all the problems any shared file is
likely to have that is constantly being chewed on from multiple engines
across a wire. There is a lot of redirection between what any particular Jet
engine might logically request and how the OS/NTFS will service that request
and everyone else's.
Today's file servers are so sophisticated that we take it for granted that
every action will be performed flawlessly. Unlike a just a few years ago
when we were thrilled if our app even connected to the network. <g> Thus we
tend to ignore building in the safeguards that were commonplace and required
in the 'old days'.
I believe a simple delay mechanism as you suggested is likely to work most
of the time. However, a particular Jet engine can become confused at times.
The message might be more of a warning that something more than just a
temporal problem is being experienced. I have found that building a
behind-the-scenes (thus transparent) complete close-down of the
engine/connection and a reconnect to be useful for the health of a mdb.
If the problem comes more severe you might consider the creation of a
Gate-Keeper and/or utilize COM+ services to logically queue requests.
hth
-ralph
.
- Follow-Ups:
- Re: Couldn't Lock File Error
- From: C Holmes
- Re: Couldn't Lock File Error
- Prev by Date: Capture Live Video on VB GUI
- Next by Date: indexing elements of array
- Previous by thread: Re: Couldn't Lock File Error
- Next by thread: Re: Couldn't Lock File Error
- Index(es):
Relevant Pages
|