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

SQL & Network Connection

Status
Not open for further replies.

Grudge

Programmer
Jul 30, 2002
23
ZA
I'm currently developing an application which uses two indicators, which shows the network status (link to server) and sql status. I need a way to check for these two, without having my app to hang while waiting (or if either on of the two might be down).

Network :

I had this idea of pinging the server every x minutes and if I don't receive anything back then there is a connection problem. The problem with this is that my app hanged whenever the connection is not working. I used a component I found on the net somewhere.

SQL :

I'm not sure how I would do this, maybe see if I can connect to it with a ADOConnectioo component and see if it works, but I think I'll run into the same problem as above if it doesn't work.

In short, I need to be able to check the status of the two (sql and network) without it affecting my application.

Any ideas ?
 
You will need a timer that will launch a thread for the network connection and another timer that will launch a thread to check the SQL connection. Each timer could also be in a seperate thread. Each thread would run independently of the main app. However, if the main app closed, you will also need to close the child threads.
James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
ok, i see what you're trying to say. how ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top