|
-
Jul 13th, 2001, 04:59 PM
#1
Thread Starter
New Member
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 ;-)
-
Jul 13th, 2001, 09:22 PM
#2
check if the file exists
VB Code:
Public Function FileExists(FileName As String) As Boolean
If Dir(FileName) = "" Then
FileExists = False
Else
FileExists = True
End If
End Function
-
Jul 17th, 2001, 08:23 AM
#3
Retired VBF Adm1nistrator
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|