!VB5: How to check status on a network sharename 
Author Message
 !VB5: How to check status on a network sharename

I try to use:

stFromDir="\\Nodename\sharename"
Dir(stFromDir, vbDirectory)

if stDirCheck = "" then
    <my error message>

If the share doesn't exist, I get the debug, End popup and not my error
message.
is there a better way than Dir() to check a status on a share?

th



Fri, 24 Nov 2000 03:00:00 GMT  
 !VB5: How to check status on a network sharename

Try:

Public Function DirExist(ByVal DirName As String) As Boolean
  On Error Resume Next
  DirExist = (GetAttr(DirName) And vbDirectory) <> 0
  On Error GoTo 0
End Function

Now you can call

stFromDir="\\Nodename\sharename"
if Not DirExist(stFromDir) then
    <my error message>

Quote:

>I try to use:

>stFromDir="\\Nodename\sharename"
>Dir(stFromDir, vbDirectory)

>if stDirCheck = "" then
>    <my error message>

>If the share doesn't exist, I get the debug, End popup and not my error
>message.
>is there a better way than Dir() to check a status on a share?

>th



Fri, 24 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to check network connection status.

2. Using VBscipt to check Network status....

3. Checking the Status of a Network Client

4. Check to see is network connection status

5. Question: How to enumerate sharenames from a network resource

6. Network neighbourhood sharenames

7. Network neighbourhood sharenames

8. Network neighbourhood sharenames

9. Checking printer status from VB5

10. Check boxes will not check! vb5

11. Check status recordset

12. vba process status check

 

 
Powered by phpBB® Forum Software