By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

link to database file

P: n/a
i have split my database and created a code that will look up for the
location of the mdb back end everytime the front end link has change.
i'm wondering if there is a way to just create and INI file to store
the location of database backend. 'cause it's very time consuming
sometimes when u change the front end (i.e. the query, forms, reports,
etc) from other computer and when u update the mdb files from other
machine it will look up again the location of database file.

thanks in advance
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Even if you use an INI file, you will still have to set the Connect property
of each linked TableDef if it is different from that used previously.

There is a way to speed up this process though. Open a connection to the
back end before you run your relink code, and release it afterwards. You do
not actually use the database variable; its function is simply to keep the
link open so Access does not have to reopen the connection for each table.

Dim dbBE As DAO.Database
Dim strPath as String

strPath ="C:\MyPath\MyFile.mdb"
Set dbBE = OpenDatabase(strPath)

'Insert your relinking code here

dbBE.Close
Set dbBe = Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"jaYPee" <hi******@yahoo.com> wrote in message
news:id********************************@4ax.com...
i have split my database and created a code that will look up for the
location of the mdb back end everytime the front end link has change.
i'm wondering if there is a way to just create and INI file to store
the location of database backend. 'cause it's very time consuming
sometimes when u change the front end (i.e. the query, forms, reports,
etc) from other computer and when u update the mdb files from other
machine it will look up again the location of database file.

thanks in advance

Nov 13 '05 #2

P: n/a
jaYPee wrote:
i have split my database and created a code that will look up for the
location of the mdb back end everytime the front end link has change.
i'm wondering if there is a way to just create and INI file to store
the location of database backend. 'cause it's very time consuming
sometimes when u change the front end (i.e. the query, forms, reports,
etc) from other computer and when u update the mdb files from other
machine it will look up again the location of database file.

thanks in advance

Simple, relink the frontend on one machine, then copy it to the other
machines. The link will not need updating on the other machines if you
use the same network share.

I've done something very "tricky" but messy... (had to solve having the
workgroup security file with the backend on a network share which may be
different at different client sites).

Using InstallShieldExpress
- during installation nstallShield prompts for the "data location"
- take this folder value and build it into the shortcuts InstallShield
will create for me
- In this shortcut I...
1) use the folder as value for the /cmd argument so it is passed to my
program.
2) use the folder as part of the path to my workgroup file
- when front-end opens it first checks this /cmd argument and attempts
to find and link to the database there and links automatically

Only problem I have is the shortcut can get too long if your path to
your back-end is really long.

Has anyone else come up with a solution to automate as much as possible
the use of Workgroup security and re-linking to a backend data file?
--
regards,

Bradley
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.