Results 1 to 3 of 3

Thread: Help - filexist on lan

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Posts
    1

    Help - filexist on lan

    I have 4 pc's connected on a simple lan, thru a hub.
    If I find them on network neighbourhood and map the three computers as drives M, N & O. What is the best way to see if the computer is connected and not been turned off as I need to access databases on their hard disks. The databases are all called the same in similar directories on each machine. If I use the DIR function to see if VB can see the file it is ok until the machine is turned off then it starts acting weird and comes uo with error messages......
    PLEASE HELP ;-)

  2. #2
    chenko
    Guest
    check if the file exists

    VB Code:
    1. Public Function FileExists(FileName As String) As Boolean
    2.     If Dir(FileName) = "" Then
    3.         FileExists = False
    4.     Else
    5.         FileExists = True
    6.     End If
    7. End Function

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    or snappier :

    Code:
    Public Function FileExists(FileName As String) As Boolean
        FileExists = Dir(FileName) <> ""
    End Function
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width