Linking back and front end - Is there a way to specify the backend path with code?

  • Thread starter Thread starter Leonard Priestley
  • Start date Start date
L

Leonard Priestley

I have written several small databases for our company, using Access 97, and
generally prefer to split the database and put the back end on the network
server. I feel uncomfortable about having to virtually hardwire the
location of the back end, because I cannot give a copy to someone else
without offering some support.

If I can, I would like to give a user who is not familiar with Access the
ability to specify where they want to put the back end. Is there any way of
coding this. I'm happy to have a script, if that's what it takes.

Leonard Priestley
 
One solution is to pop up the File Open dialog so the user can locate the
data file. Set the Connect property of each TableDef, and the setting will
be retained. If the data file is ever moved or the path/server named
changed, the dialog will pop up again.

The API calls you need for the File Open dialog are here:
http://www.mvps.org/access/api/api0001.htm

For an example of how to assign the TableDef Connect property, see:
http://allenbrowne.com/ser-13.html
Remember to include the RefreshLinks bit.
 
Back
Top