Split database

P

Peter Smith

Hi all,

I split my database a while back and have it up at 2 sites with a small
local network at each site. Now I want to add a new table and expand some
others. But - I do my development on A97 at home and the work computers
are A2000.

Since each front end has to link to data at a different relative place on
the network, how best to go about this update since I can't use the link
updater in A2000??

Thanks

- Peter
 
N

Nikos Yannacopoulos

Peter,

Not sure this will work, but there's a good chance it will, so you may want
to give it a shot. The idea is to change the links through code, which I do
just for convenience when transfering the database between home and work,
but it might solve your other problem also (just copying from an older post
of mine):

I have a similar situation, and have put together the following piece of
code to change my links in seconds, with one move. The trick is that my
Windows user name is differect in each location, so checking it the code can
determine where it's running. Just make sure you put in the correct (office)
username and the correct path for both sites.

Function change_links()
Dim db As Database
Dim tbl As TableDef
Dim cp As String 'current path
Dim np As String 'new path
Dim lnk As String 'link string

Set db = CurrentDb()
usr = Environ("UserName")
If usr = "OfficeUserName" Then
cp = "C:\HomePath\"
np = "\\ServerName\OfficePath\"
Else
cp = "\\ServerName\OfficePath\"
np = "C:\HomePath\"
End If

For i = 0 To db.TableDefs.Count - 1
tbln = db.TableDefs(i).Name
Set tbl = db.TableDefs(tbln)
lnk = tbl.Connect
If Left(lnk, 9) = ";DATABASE" Then
lnk = Replace(lnk, cp, np)
tbl.Connect = ""
tbl.Connect = lnk
tbl.RefreshLink
End If
Next
End Function

HTH,
Nikos
 

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