How to tell if Relink Access tables from code is working

T

Tony Girgenti

Hello.

I used this function Relink Access Tables from code from
http://www.mvps.org/access/tables/tbl0009.htm

In testing, i noticed that in order to use it the tables have to be manually
linked to start with.

In that case, how do i know if this function is really working ? How do i
know that access is not just keeping the link from the first time i linked
them manually ?

Any help would be gratefully appreciated.

Thanks,
Tony
 
D

Douglas J. Steele

Well, you could believe us when we say that code definitely works <g>, or
you could do a test by linking it to a copy of the back-end database in
location A, moving that database from location A to location B and then
running the code.
 
T

Tony Girgenti

Hello Doug.

I did try that and here is what i found.

First, before i split the database, i was linking four tables to another
X.MDB and the relink function worked fine. It relinked the four tables.

Then, i split the database and it linked two tables(Switchboard and
TempStatus) to the be.MDB table and left the other links to the X.MDB table.
The relink function still worked fine.

When i tried your suggested test, i first moved only the be.MDB file to
another area and started the .MDB. It gave me the error "Could not find
file '\\.....be.mdb'". I click OK and Access stays open but the mdb is not.

Then i moved only the X.MDB file and started the .MDB. It temporarily
displays the switchboard menu, then it dissapears and the status line at the
bottom displays "Now linking 'Status'... ", but never does anything else.
Status is one of the tables linked to the X.MDB.

I'm not sure if i should be concerned about these results or if they are as
expected.

Why didn't it give me an error after i moved the X.MDB file?

Thanks,
Tony
 
D

Douglas J. Steele

That code isn't intended for the situation where your linked tables are in
more than one back-end database, which appears to be what you've got.

It's also not clear to me how you're using the code in
http://www.mvps.org/access/tables/tbl0009.htm When you run the code as-is,
the first thing you're supposed to get is a message box asking "Are you sure
you want to reconnect all Access tables?". From your description, you're not
getting that, which makes me suspect that you either changed the code (in
which case we'd need to see your modified code in order to be able to answer
any specific questions), or else you're not calling fRefreshLinks anywhere
in your code.
 
T

Tony Girgenti

Hello Doug.
more than one back-end database, which appears to be what you've got. <<

Should i try to get all back end tables into one back end database? Or, is
that a dumb question?

Yes, I did modify the code to take out the message boxes. I simply display
a label on the switchboard form that it was relinked successfully.

Thanks,
Tony
 
D

Douglas J. Steele

Unless you've got a good reason for all of the tables not to be in the same
back-end, yes, my advice would be to consolidate into one.
 
T

Tony Girgenti

Hello Doug.

I'm not sure of how to do that. When i first started this project, the
database was not split. I was using four linked MDB tables, one ODBC linked
table, and two local tables (TempStatus and Switchboard).

At some point i split the database and it put just the two tables
(TempStatus and Switchboard) in to the be.MDB. I don't remember seeing any
option of which tables to include in the split be.MDB.

Any help that you can provide to do what you suggest would be gratefully
appreciated.

Thanks,
Tony
 
D

Douglas J. Steele

Open the back-end database.

Choose File | Get External Database | Import from the menu.

Find the "other" back-end and select the first table.

Repeat until you've imported each of the tables.
 
T

Tony Girgenti

Hello Doug.

Excellent.

Thanks,
Tony

Douglas J. Steele said:
Open the back-end database.

Choose File | Get External Database | Import from the menu.

Find the "other" back-end and select the first table.

Repeat until you've imported each of the tables.
 
D

David W. Fenton

That's fine for cases where it makes sense to have tables in more
than one back-end.

I don't have any such apps -- all of mine have a shared back-end
datafile and a temp database.
There would appear to be no need for that in Tony's case.

You'll note that in my reply I didn't not quote Tony's situation at
all, only your statement about the relinking code you'd offered
working only with a single back end.
 

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