I do it all the time..and never had a problem, even when other users are
in...
> I have run a few tests and linking seems to be much slower if other users
> are connected. Does anyone know why?
Yes, you need to keep a persistent connation open to the back end. This
advice not only applies when re-linking, but for general running of your
application. Those delays you see are actually occurring *all over* the
place..and you can remove those delays by keep a persistent connection open.
Of course, you keep a persistent connection open by simply opening *any*
table in the back end from the front end..and *keep* it open while you do
your operations. the problem is that when linking...you don't have a link
yet!!
The solution is in your re-link code to put in some code that after the
first table is linked..you open it!!!
The result is linking that will occur as fast as when no other users are in
the back end....
Here is a code snip:
For Each mytables In CurrentDb.TableDefs
strOld = mytables.Connect
strBackPart = strGetDbTable(mytables.Connect)
strTo = strReLinkDir & strBackPart
If Len(mytables.Connect) > 0 Then
If Left(mytables.Connect, 10) = ";DATABASE=" Then
mytables.Connect = ";DATABASE=" & strTo
mytables.RefreshLink
If bolFirst = False Then
Set rstFirst = CurrentDb.OpenRecordset(mytables.Name)
bolFirst = True
End If
End If
End If
Next mytables
If bolFirst = True Then
rstFirst.Close
Set rstFirst = Nothing
End If

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal
Bill - 30 May 2006 19:36 GMT
Thanks for the quick response Albert.
I'll try puting the open table code into my linking routine after the first
table is linked and see how it goes.
Thanks,
Bill
>I do it all the time..and never had a problem, even when other users are
>in...
[quoted text clipped - 44 lines]
> Set rstFirst = Nothing
> End If