Access 2007 Check for linked table availability

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that uses linked tables. Sometimes the files are not
available or become unavailable during a runtime sessions. 2 questions...

1 How to I check to see that the tables are available on the network when
the program starts...
2 What is the best way to recover if while in a data entry form the network
goes down and the linked tables are unavailable.
 
#1. Write a VBA procedure that attempts to OpenRecordset on a linked table.
That will fail if the linked table is unavailable. Use error handling to
recover gracefully. You can then ask the user to locate the file, or shut
down gracefully.

#2. Assuming all your updates are made through forms, you can use the Error
event of the form to trap for this error. But the reality is that Access
doesn't cope to well with networks that fall apart, i.e. you are likely to
end up with a corrupted database. To get a reliable database, you must
stress this to whoever administers the network, and so you don't really need
to expend much effort on handling this.

The first one is worth the effort though. You do need to know that the
machine is connected when it starts, and that the server or path has not
been renamed, and the database is not corrupted. The simple attempt to
OpenRecordset handles this.

There's a sample database that shows how to test and reconnect. It's the
module in solutions.mdb here:
http://support.microsoft.com/kb/248674/en-us
 
Thanks Allen,

That is exactly what I need. I will not bother with the form error as you
suggested. The network we have is very reliable so that should not be a
problem I was just wondering "What if...."
 
Back
Top