What is the better way to know if the program has access to another computer in the local network

I am doing a program (Visual Basic 6) that access to another computer in the local network, so I need to make a function that tells me if the computer is accessible. Only this, if it is accessible.

I have the name (not the IP) of the computer to test if I have access, and perhaps the computer running the program has no access to a DNS server (for example, a laptop that it is not at the office). Both computers, the one which is running the program and the one that must be accessed, belong to a Windows Domain in a Windows 2000 or Windows 2003 environment).

The question is that this function must answer as fast as possible.

Essentially, I need to know if the destination computer has a SQL Server and if it is sharing a -specific- directory.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gllanderasAuthor Commented:
Thanks, hes, but I'm looking for something faster.

I wonder if is possible to do using WMI. I did a experiment with this code (vbscript):

On Error Resume Next

strConnection = "winmgmts:\\comp1"

Set objWMIService = GetObject(strConnection)
lngError = Err.Number
Set objWMIService = Nothing

If lngError = 0 Then
  MsgBox "OK."
  MsgBox "NOK:" & CStr(lngError)
End If

But this seems to work only if the user is a member of the administrative group of the domain.
gllanderasAuthor Commented:
hes, thanks for your help.

I assume that the only way to do this is sending a ping to the computer with the code posted in that link.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.