Relink to back end, has to be programatic?

N

njem

I find msgs here about relinking to the back end but they all seem to
involve code. I can't believe there isn't another way. I develop the
db at my office, then connect to the user's site and upload front end
and back. I don't want to use a drive letter as a path because then I
have to create such a mapped drive on each system. But the network
path doesn't exist in my office so I can't "find" the back end at the
right path here. I tried checking the "always ask for a path" box in
the link manager. Not sure what that's supposed to do but when I moved
it to the user's site it simply couldn't find the back end and that's
that. There must be some way to either manually enter a path at the
office even though it isn't valid until it gets to the user's site, or
have the db ask to refind the back end when it can't find it, without
having to use some code, isn't there? I can write a little code or
copy some, but there really isn't anything built into Access to do
this itself?

Thanks
access 2007
 
T

Tom Wickerath

Hi Njem,
I find msgs here about relinking to the back end but they all seem to
involve code. I can't believe there isn't another way.

Well, you can always re-link manually, using the Linked Table Wizard. But
that's generally not considered a polished solution suitable for distribution
to a paying client.
I don't want to use a drive letter as a path because then I
have to create such a mapped drive on each system.

A wise decision. I recommend always using UNC (Uniform Naming Convention)
paths, which do not rely on mapped drive letters.
I tried checking the "always ask for a path" box in
the link manager. Not sure what that's supposed to do...

The "Always prompt for new Location" box should cause a file browse dialog
to be displayed as soon as one clicks on the OK button (assuming they
selected at least one linked table) even if the linked path is valid.
There must be some way to either manually enter a path at the
office even though it isn't valid until it gets to the user's site,...

Yes, you can do this, but it will take some VBA coding effort on your part.
You would store the valid paths in a local (not linked) table, for your
computer, and for your client's PC. And you would perhaps have code to
identify the current user's NTUserID (see
http://www.mvps.org/access/api/api0008.htm to get this value), and decide,
based on this value, which record in the local table has the correct path.
The chances of your customer having the same exact NTUserID as you are likely
fairly minimal, but in the event this might be an issue, you could use
additional code to query the name of the computer, so that both values would
have to match before the path in the record that points to your computer
would be used.
...or have the db ask to refind the back end when it can't find it, without
having to use some code, isn't there?

Without code? No way that I am aware of...
However, Access MVP Armen Stein makes his table relinking code available for
free (all he asks is that you maintain all of the information in the comments
section). You can get a copy from his download site. Look for "J Street
Access Relinker", which is currently the first download listed:

http://www.jstreettech.com/cartgenie/pg_developerDownloads.asp
I can write a little code or copy some, but there really isn't anything
built into Access to do this itself?

Nope. And since you are using Access 2007 you should make sure to have a
special Autoexec macro that checks whether or not the folder is trusted. An
example of such a macro can be found in the A2007 version of a download that
I have available, here:

http://www.accessmvp.com/TWickerath/downloads/tmpwrkdb.zip

Good Luck! What you are wanting to achieve is "do-able" but you'll very
likely need to write some VBA code, and store the valid paths to the BE
database in a local table.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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