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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Connection Status

Status
Not open for further replies.

gust1480

Programmer
Mar 19, 2002
148
0
0
PH
Hi! am trying to create a program in vb that would contantly check the status of my connection with SNA and I used the following code (COM) to do so.

Set WmiLocator = CreateObject("WbemScripting.SWbemLocator")
Set WMINamespace = WmiLocator.ConnectServer("", "root\MicrosoftHIS",
vbNullString, vbNullString, vbNullString, vbNullString, 0, Nothing)


but my problem now is that it sometimes hang on the code specified. Is there a way to prevent this?
 
This is a WMI connection...instead of 0 try using 128 which should force your script to wait a maximum of 2 minutes for a return.

If this does not fix your issue then it could be that WMI is corrupted on the machine you are attempting it on. You can try using WBemTest to verify.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top