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

HOW DO I GET THE LETTER OF A LINKED TABLE? 1

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi,

I need to get the letter from a linked table.

Basically I use 2 systems (laptop and PC/server).

If the laptop is connected to the server, then all tables are linked to the server (I run a routine to do that which works great) everytime I login.

But instead of relinking the tables everytime I login, I want to see if the tables are already linked to L:\ path (the server).
If so, I don´t want to relink again.

thanks



 
Hi

The "Usual" method is to attempt to read a field name within a linked table, this will return an error if the link is broken

To find the datapath (and hence teh drive letter you could examine the .connect property of the tabledef object

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
you could try something like this.
Code:
Public Sub test_connect()
    Dim strTest As String, db As DAO.Database
    Dim td As DAO.TableDef
    Set db = CurrentDb
    For Each td In db.TableDefs
        If Len(td.Connect) > 0 _
             MsgBox Mid(td.Connect, 11, 1) ' This is the drive letter
        End If
    Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top