Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a quick way to test network connection 2

Status
Not open for further replies.

Ime532

IS-IT--Management
Apr 1, 2004
89
US
I need a way to see if a user is connected to our internal network (with a domain) that will not significantly slow down the program (with a 20 second delay or something like that). If they are connected to the network i would have them connect to an access database on a shared drive. Thanks!
 
Why not just set the timeout of the connection object to 20 seconds and if the connection times out then capture the error and prompt the user that the connection is broken.

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
You could also just check if the folder exist:

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists("\\Your_Server\Your_Folder")) Then
msgBox "Exist"
Else
msgBox "Doesn't Exist"
End If

Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Use the Dir function?

If Len(Dir("\\Jmlaptop\stan\test.mdb")) > 0 Then
' File & connection exists
Else
' Do whatever
End If

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Well I don't want there to be a delay at all, so I think the Dir function will work, just wasn't sure how much of a delay there would be. Thanks!
 
using the file scripting object turned out to be better because it doesn't raise an error. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top