Wednesday, 4 September 2013

VB6+Access(ADO/JET) Randomly getting "Disk or Network Error" or "Cannot find the input table or query X on Database Y"

VB6+Access(ADO/JET) Randomly getting "Disk or Network Error" or "Cannot
find the input table or query X on Database Y"

We have a Practice Management system that is about 15 years old. I've been
working on it for about 12, and I've never encountered this problem until
just recently, and we can't figure it out.
It is written in VB6 which uses ADO/JET to access an Access .mdb file on
the network. The application opens the connection when it starts, keeps it
open while it's open, and closes it when it exits. It does a LOT of stuff
with the DB - the system deals with Patient Accounts, Charges, Payments,
Scheduling Appointments, and about a million other things. We have dozens
of clients that use this program, each with their own DB and most of them
'offsite', where they have their own server, some number of workstations,
between 1 and 20 users, pounding away at the system 24 hours a day, 7 days
a week, and except for the occasional DB field bug or having to
compact/repair DBs, it's pretty stable.
About 3 weeks ago, we started seeing a problem that we hadn't seen before.
We have an 'in-house' system setup for us to use: the DB is on our Server
which houses maybe 10 other DBs, and only a couple of people connect in to
this system. We started noticing that if someone logged into the system,
went straight to our Scheduler screen, and then sat idle for about 5-10
minutes, they might get "Disk or Network Error", or "Cannot find the input
table or query X on database Y".
What's strange is that it SEEMS to happen only when 2 or more people are
logged into that DB from different computers, and then one of them will
get the error (Randomly?) but the other 2 users will be fine.
There is a Timer on the 'main' MDI Parent form of the system which wakes
up about ever minute (there are some things which will change the interval
to a shorter interval, and there are some things which disable the timer,
but we don't think either of them are happening in this situation). It
performs a pretty basic SQL Query on the DB:
SELECTloggedinFROMUsersWHEREUserId= 'DBUPDATER' THIS is the SQL Query that
seems to be ALWAYS triggering one of those errors.
There is also a timer that runs about every 2 minutes while a user is
logged in to check for emails and a few other things that would be running
during this time. And since they are on the Scheduler screen, there's a
timer on there that runs every 30s or so which will check the DB to see if
any changes to the scheduler have been made to see if it needs to refresh
the screen or not.
There are some other strange things: The DB and the Users table seem to be
perfectly fine. When the person who gets the error logged into the system
- usually only 5 minutes earlier - the system HAD to look at the Users
table to mark them as Logged in, and I'm almost 100% sure that the query
that it's dying on had been run at least once - probably 4-5 times before
it dies.
Once a user gets this error, if they leave the Error's MessageBox on the
screen (not quit the .exe), if they try to access that DB file in any way,
they get "Disk or Network error" - this includes if they try to open that
DB in Access. HOWEVER, they can still get to the Network just fine, and
even open up other mdb files IN THE SAME FOLDER as the one they can't
open. OTHER PEOPLE on other computers can open that mdb without any
errors. Once the user acknowledges the Error, and allow the exe to close,
they can open that DB file again just fine.
I'm told that this is not in anyway a Network issue. Our IT guy says he's
run pings and traces and all sorts of tests to ensure that the network
connection is not getting dropped. I've also run some things on the DB to
make sure it's not corrupted and it seems to be fine - and we get it to
happen on other DBs.
If anyone has seen anything like this and knows a possible fix, I would
greatly appreciate it! Thanks!

No comments:

Post a Comment