LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DB Tools Open Connection.VI timeout

Hi,
   I'm using the DB Tools Open Connection.VI to write to a SQL database on a network. I open and close the connection each time I write or read from the database. This works fine as long as the computer is connected to the network. If for some reason I loose my network connection then the VI takes forever to timeout. I'm also writing to a local Microsoft Access database on the same computer. I do this just in case I do loose the network connection. My question is, it there a way to quickly run this VI if I loose my network connection? This way even though I'm not able to talk to the SQL database at least my application will keep running. I've tried to adjust the timeout time with no sucess. thanks
0 Kudos
Message 1 of 3
(3,280 Views)
You can ping the destination computer on the network before opening the database connection.  Use System Exec.vi and input "ping (ip address) -n 1 -w 100".  The -n 1 tells it to only try once and the -w 100 tells it to only wait for 100ms.  You can then decode the results and see if there is a network problem before you try to open the database connection.
0 Kudos
Message 2 of 3
(3,269 Views)
Thats a good idea. Thanks!
0 Kudos
Message 3 of 3
(3,235 Views)