Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 23rd, 2006, 12:28 PM
Authorized User
Join Date: Jun 2004
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Linked Table

Is there any way to edit the path of a linked table?

Julio Cesar

-"Bueller.......... Bueller.......... Bueller.......... Bueller.........."
Julio Cesar

-\"Bueller.......... Bueller.......... Bueller.......... Bueller..........\"
Old February 24th, 2006, 07:29 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts

Try something like:

Dim cat As ADOX.Catalog
Dim tdfRelink As ADOX.Table
Dim strPath As String
Dim strName As String
Dim intCounter As Integer

Set cat = New ADOX.Catalog
With cat
    .ActiveConnection = CurrentProject.Connection
    strPath = ‘Your path’
    strName = ‘Your file name’

    For Each tdfRelink In .Tables
        intCounter = intCounter + 1
            If .Tables(tdfRelink.Name).Type = "LINK" Then
                tdfRelink.Properties("Jet OLEDB:Link Datasource") = strPath & strName
            End If
    Next tdfRelink
End With



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read-Only Linked Table pjm Access 6 August 21st, 2006 07:42 AM
Can a Make Table Query produce a Linked table? kronik Access 5 May 16th, 2006 06:17 AM
Linked table issue leehambly Access 2 November 26th, 2004 01:28 PM
linked table Tasha Access VBA 1 August 6th, 2004 03:04 PM
Help! Detect if linked table is available giswim Access VBA 2 October 3rd, 2003 06:39 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.