Help explain how relinking code works...

  • Thread starter Thread starter Fred Boer
  • Start date Start date
F

Fred Boer

Hello! I am in the process of implementing code which will allow the user to
relink my backend tables if they are moved or renamed. I am using code from
The Access Web (http://www.mvps.org/access/tables/tbl0009.htm and
http://www.mvps.org/access/api/api0001.htm). The code is working, however,
the *way* it is working is confusing me and I would love an explanation.
Ok..here goes:

I move the backend MDB to a new directory. The code pops up a messagebox
saying that the data tables aren't found and do I want to reconnect. Click
on "Yes". Another messagebox then pops up and asks if I want to "specify a
new path for the data tables".

1. If I click "Yes", I get a window within which I can browse to the back
end MDB. I select it, click "Open", and *all* the tables my application
needs are relinked.
2. If I click "No", I get a window within which I can browse to the back end
MDB. I select it, click "Open", and only *one* of the tables my application
needs are relinked. Then the window is displayed again. If I continue to
enter the name of the back end MDB over and over, eventually *all* of the
tables are relinked.

I have no doubt the code is functioning correctly; however, I don't
understand why it works differently if I choose to "specify a new path" or
not. Could someone explain?

Thanks!
Fred Boer

P.S. I have looked at the code, but it is complex enough to scare me! <g>
 
I haven't looked at the code in question, so I can not comment on it. Maybe
it is catering for the case where different tables are linked to different
back-ends? Then it would have to prompt you table by table. The prompt text
should reflect that clearly.

HTH,
TC
 
Fred said:
Hello! I am in the process of implementing code which will allow the user to
relink my backend tables if they are moved or renamed. I am using code from
The Access Web (http://www.mvps.org/access/tables/tbl0009.htm and
http://www.mvps.org/access/api/api0001.htm). The code is working, however,
the *way* it is working is confusing me and I would love an explanation.
Ok..here goes:

I move the backend MDB to a new directory. The code pops up a messagebox
saying that the data tables aren't found and do I want to reconnect. Click
on "Yes". Another messagebox then pops up and asks if I want to "specify a
new path for the data tables".

1. If I click "Yes", I get a window within which I can browse to the back
end MDB. I select it, click "Open", and *all* the tables my application
needs are relinked.
2. If I click "No", I get a window within which I can browse to the back end
MDB. I select it, click "Open", and only *one* of the tables my application
needs are relinked. Then the window is displayed again. If I continue to
enter the name of the back end MDB over and over, eventually *all* of the
tables are relinked.

I have no doubt the code is functioning correctly; however, I don't
understand why it works differently if I choose to "specify a new path" or
not. Could someone explain?

Thanks!
Fred Boer

P.S. I have looked at the code, but it is complex enough to scare me! <g>


It's giving you the option of having your tables spread out
over many backend MDBs (almost like what the Link Table
Manager does).

If you weren't so scared, you could remove the No button or
modify the procedure to always do all the tables. Come on
Fred, don't be afraid, you can do it. After all, it's only
code. ;-)

If you are ever using multiple backends, then you might also
want to look at David Fenton's relinker at:
http://www.bway.net/~dfassoc/download/Access/Reconnect.html
 
Thanks Marsh! I don't use multiple back ends, and I would like it to always
relink all the tables at once. So, ok, at lunchtime today I'll do battle
with the code! I ain't 'fraid of no code! ;)

Fred
 
LOL

Go for it!
--
Marsh
MVP [MS Access]


Fred said:
Thanks Marsh! I don't use multiple back ends, and I would like it to always
relink all the tables at once. So, ok, at lunchtime today I'll do battle
with the code! I ain't 'fraid of no code! ;)

Fred
 
Back
Top