PDA

Click to See Complete Forum and Search --> : VB.NET 2005 - SQL Connection Problem - Find Network Status?


jantman
Jun 19th, 2006, 12:16 PM
I am building a database application which runs on laptops in vehicles. The idea is that the user fills out a form while on the road, it is cached locally, and then sent to the DB (MySQL) over the wireless network when the user returns to the site.

I have the program try to connect to the server every 10 seconds.

The problem I am having is:

1) when the vehicle leaves the site, with the program running, it thinks it can connect (and tries, and errors) even if there is no network connection

2) if I start the program in the vehicle while offsite, and then return and the network connects, the program still sees no network and won't connect.

I am using Microsoft ODBC Data Control and MySQL Connector/ODBC. Is this a problem with the drivers, or do I just need to call some Windows function to tell if the network is connected? How do I do this?

Any help is greatly appreciated.

Thanks,
Jason

Al42
Jun 19th, 2006, 04:03 PM
You need to either ping the server or try to connect to some intranet page, send it a request and test for the proper (whatever you've written that page to respond with) return.