Check Server Status for Linked Tables

G

Guest

My Database has some linked tables on another server. How can I check that
the server is available before 'running my other codes'?

Using the example below I can check a folder but really in this case I just
need to check the servername which does not work if I have varPath =
"\\myServer"

Is their a function to check the computername?
Should I verify the linked table connection another way?

Bruce

Sub test()
varPath = "\\myServer\Groups\Market"
MsgBox (FolderExists(varPath))
End Sub

Public Function FolderExists(varPath As Variant) As Boolean
On Error Resume Next
If Len(varPath) > 0& Then
FolderExists = (Len(Dir$(varPath, vbDirectory)) > 0&)
End If
End Function
 
A

Alex Dybenko

i think you can just try to open a recordset based on linked table - if you
get an error - then path does not exists, so you need to relink table
 
D

David C. Holley

I suspect that there's a specific error code that would be returned
indicating a problem with the link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top