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!

Checking for a connection...

Status
Not open for further replies.

BPMan

Programmer
Jun 25, 2002
163
0
0
US
is is possible to check to see if a computer is connected to a network........
and if so how....
thanks
BPMan
 
If you are trying to connect you can use this

Sub conntectToDb()
On Error goto eh

Dim DBConn as ADODBconnection
DBConn.open(connstring)
Exit Sub
eh: 'error unable to connect
End Sub
 
well what i do is use a access database that is stored on the server.........
buy what i want to is if the user is not connected to the internet just out put a message at the start of my program and then end my program..........
...........
 
try something like this:
put this after your connection is opened

dim msg as integer

If connectionname(like DBConn above).state = 0 then
msg = msgbox("You're not connected to the network")
if msg = 0 then
end
end if
end if ----------------
Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top