Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked Table Manager

Status
Not open for further replies.

lasitha

Programmer
Jun 7, 2003
38
LK
Hi All,

I have two mdb files, one file is a cilent vertion and other one is server vertion. I'm going to install through the setup those two files (mde).
Client db file have link tables with server db, forms, reports etc.,
In server vertion has only tables.

Problem is when I install client vertion to clients mechins tables links are broken down. If there is a way to control this thing through the VBA code.

ThankX,
Lasitha Alawatta.
 
I dont quite understand your question. The following code relinks tables, I hope it helps you through your problem. I cant remember where I found the code so I cant acknowlodge the original author.

I had a client where even though the client db was on the same server it was mapped with a different drive letter on several machines and found that using the server directory identy ie //servername/pathname/filename worked independent of the drive mapping

Code:
    Dim tbl As TableDef
    Dim stablename As String
    Dim DatabasePath As String
        
 DatabasePath = [PathName] & "\My.mdb" 
'sets up path to client db you can use either mapped drive or server path you can hard cod this in or ask for the path on login
    For Each tbl In CurrentDb.TableDefs
        If tbl.Connect <> "" Then       ' Isn't a local table
            stablename = tbl.Name
            CurrentDb.TableDefs.Delete (stablename)
            DoCmd.TransferDatabase acLink, "Microsoft Access", DatabasePath, acTable, stablename, stablename
        End If
    Next
    
   CurrentDb.TableDefs.Refresh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top