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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked Tables - lined to which database 1

Status
Not open for further replies.

LittleSmudge

Programmer
Mar 18, 2002
2,848
GB
I have a DataStore database containing just the tables and another database called FrontEnd containing the Forms, Reports etc.

The DataStore has been replicated and different replicas places on servers geographically distributed around the country. Each user has a copy of FrontEnd on their machine and each FrontEnd should be linked to their local copy of DataStore

Due to things beyond my control the \\ServerName\PathName\DatabaseName is a long string. Therefore when I use the Linked Table Manager to see which replica a particular FrontEnd is linked to I cannot get access to the right hand end of the string. The dialog box is not expandable and the width of the window is nowhere near wide enough to see the filename.

Does anyone know of an other way of interogating the \\Server\Path\File of the linked tables?



G LS
 
This function will print all the connect strings to the immediate window. You could change this to print to a table if you wanted. You could also change it to ignore tables with no connect string (presumably local tables). But I'll leave these ideas to you :)


Function GetLinkedConnectStrings()
'Created by: Neal A. Kling
'Created : 4/22/99 9:57:53 AM
On Error GoTo Err_GetLinkedConnectStrings

Dim db As Database
Dim doc As Document
Dim tbf As TableDef

DoCmd.Hourglass True
Set db = DBEngine(0)(0)
'Set db = DBEngine.OpenDatabase("c:\test\billingdata.mdb")

For Each tbf In db.TableDefs
DoEvents
If Not Left(tbf.Name, 4) = "MSys" Then
'ignore system tables
Debug.Print tbf.Name & "; " & tbf.Connect
End If
Next tbf

Exit_GetLinkedConnectStrings:
On Error Resume Next
DoCmd.Hourglass False
db.Close
Set db = Nothing

Exit Function

Err_GetLinkedConnectStrings:
Select Case Err
Case 0 'insert Errors you wish to ignore here
Resume Next
Case 3011 'object not found
Resume Next
' Case 3045 'database already in use
' Beep
' MsgBox
Case Else 'All other errors will trap
Beep
MsgBox "Error deleting tables.@" & Err.Number & "; " & Err.Description
Resume Exit_GetLinkedConnectStrings
End Select
Resume 0 'FOR TROUBLESHOOTING
End Function
"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Thats great 930driver. As usual its a matter of not doing the job the way it was originally intended - but finding an alternative path the the same outcome.

I'll can now convert that to ADO.

Thanks.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top