VB to see if file is present and linked table question.

M

Mark

Hi All,

We presently have 3 databases that the user open's exclusively, then backs
them up. Then they also, have to disconnect linked tables, then do some
reports then relink them. They're doing this manually. I know it can be
done with a push of a button.

I'm creating another database just to run the backups and linked table

My questions are:

1. Doing a backup is nothing more then copying the file to the backup
folder, but I need to make sure it is not open by someone prior. I can look
to see if the .ldb is present. How would I accomplish this? And is there a
better way?

2. I know we have other programs out here that link the tables as you
connect. What command or function do I use to link tables via code? And can
it be done outside the database I want to update?
 
M

Mark

I think I found my is file present by using this.

If Len(Dir("\\Bbmkfs02\groups\Status Reports\EAP\EAP.ldb")) = 0 Then
MsgBox "This file does NOT exist."
Else
MsgBox "This file does exist."
End If

Is this the best way?

Still need the linked table procedure.
 
D

Douglas J. Steele

It's as good a way of determining as any, but be aware that if someone
opened the database as read-only and exclusive, no locking file is created.
 
D

Douglas J. Steele

Why do they need to disconnect the linked tables in order to run reports?
That doesn't make much sense...
 
M

Mark

They have to break a link to the main database and connect to the backup.
I'm not sure why it's done this way (not my db), but I was trying to keep
them from doing it manually. Right now they do it manually and to 50 plus
tables. Not sure what happen, but a few month’s ago a co-op worked on it and
since all linked table come up individually even though there all using the
same link. Real time consuming.
 
D

Douglas J. Steele

Okay, it was semantics that caught me up. "have to disconnect linked tables,
then do some reports then relink them." implies that the linked tables are
deleted, the reports run and then the tables linked again. Sounds as though
you mean "have to change the linkage of linked tables, then do some reports
then link them back to the original source."

Check the code in http://www.mvps.org/access/tables/tbl0009.htm at "The
Access Web", or grab the free J Street Access Relinker at
http://www.jstreettech.com/cartgenie/pg_developerDownloads.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top