PC Review


Reply
Thread Tools Rate Thread

Check Server Status for Linked Tables

 
 
=?Utf-8?B?QnJ1Y2U=?=
Guest
Posts: n/a
 
      29th Jun 2005
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


 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      29th Jun 2005
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

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"Bruce" <(E-Mail Removed)> wrote in message
news:37025C68-46F3-408E-A8CD-(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      29th Jun 2005
I suspect that there's a specific error code that would be returned
indicating a problem with the link.

Alex Dybenko wrote:
> 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
>

 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      29th Jun 2005
IMHO, it is enough just to check for any error.
here a sample code:
http://www.mvps.org/access/tables/tbl0009.htm

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"David C. Holley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I suspect that there's a specific error code that would be returned
>indicating a problem with the link.
>
> Alex Dybenko wrote:
>> 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
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked tables became hidden tables on Server Crash FrankG@fnis Microsoft Access External Data 1 30th Jan 2009 06:20 PM
Function to check if linked tables are attached dch3 Microsoft Access VBA Modules 2 30th Apr 2008 01:27 PM
SQL Server 2000 linked tables - slow performance since server transition davenwhoutson@gmail.com Microsoft Access External Data 1 13th Aug 2007 11:24 PM
Linked Tables - Check if tables are available on startup? chris@ukrm.org Microsoft Access 7 22nd Mar 2006 04:20 PM
Is there a way to check link´s for linked tables? Niklas Östergren Microsoft Access 5 12th Jan 2005 10:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 AM.