Want To Do A Re-Link All My Tables Within A Macro

J

Jim Hill

I do a copy command within a batch program to make a copy
of 5 databases which are all linked together.

I then want to re-link all of them to each other in the
new location.

I know how to do it manually with the Linked Table
Manager, but I need it to happen every night.

ANy ideas???

Jim
 
D

Douglas J. Steele

I don't think you'll be able to do it using a macro, but you can with a VBA
module.

Start by looking at http://www.mvps.org/access/tables/tbl0009.htm at "The
Access Web". You'll have to remove at least:


strMsg = "Do you wish to specify a different path for the Access
Tables?"

If MsgBox(strMsg, vbQuestion + vbYesNo, "Alternate data source...") =
vbYes Then
strNewPath = fGetMDBName("Please select a new datasource")
Else
strNewPath = vbNullString
End If

and replace it with code that sets strNewPath to whatever it is you want to
change the connections to. (If you're doing this in batch, doubtlessly
there's other User Interface components you'll need to eliminate or change)
 

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