From: golfinray on
Is there a way to programatically change the unc path to all linked tables at
once?
--
Milton Purdy
ACCESS
State of Arkansas
From: Douglas J. Steele on
Only by using VBA to loop through the TableDefs collection and changing each
one that needs to be changed.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"golfinray" <golfinray(a)discussions.microsoft.com> wrote in message
news:1224B3F2-9E6F-4A15-87B8-8086A3C7F05A(a)microsoft.com...
> Is there a way to programatically change the unc path to all linked tables
> at
> once?
> --
> Milton Purdy
> ACCESS
> State of Arkansas


From: Armen Stein on
On Wed, 9 Dec 2009 09:25:01 -0800, golfinray
<golfinray(a)discussions.microsoft.com> wrote:

>Is there a way to programatically change the unc path to all linked tables at
>once?

You can use our free J Street Access Relinker. Just browse using
\\server instead of a drive letter to get the UNC patch.

http://www.jstreettech.com/downloads

It handles multiple Access back-end databases, ignores ODBC linked
tables, and can automatically and silently relink to back-end
databases in the same folder as the application (handy for work
databases or single-user scenarios). There's a ReadMe table with
instructions.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com

From: Brian on
Here is part of what I use, and it may get you close. My full code also
includes a browse button so the user can browse to the new back end, but here
is the germane portion. If it does not work because I have missed a variable
declaration or something, I may have to just send you the whole form that I
use

Private Sub ButtonReLink_Click()
Dim FilePathData as String
FilePathData = "\\MyServer\MyShare\MyDBFolder\MyDB.mdb" 'path to back end

'open DB connection before re-link to make it faster
Dim dbData As DAO.Database
Set dbData = OpenDatabase(FilePathData)
're-link
Set dbProgram = CurrentDb
txtStatus = SysCmd(acSysCmdInitMeter, "Refreshing Links...",
dbProgram.TableDefs.Count)
For TableCount = 0 To dbProgram.TableDefs.Count - 1
If dbProgram.TableDefs(TableCount).Connect <> "" Then
dbProgram.TableDefs(TableCount).Connect = ";DATABASE=" &
FilePathData & ""
dbProgram.TableDefs(TableCount).RefreshLink
txtStatus = SysCmd(acSysCmdUpdateMeter, TableCount)
End If
Next TableCount
StatusReset
'close DB connection
dbData.Close
Set dbData = Nothing
End Sub
"golfinray" wrote:

> Is there a way to programatically change the unc path to all linked tables at
> once?
> --
> Milton Purdy
> ACCESS
> State of Arkansas