LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DBConnect : SQL Toolkit, test with network shut down

Hello everybody,

I have a question about the SQL Toolkit under CVI.

I must test network connection in my application and all worked well until I simulate a shutdown of network (I remove the network cable of my PC so that my application works in local mode).

But when I plug back the cable, my DBConnect function doesn't work any more properly : its return value is random, sometimes it returns 2, so my application consider that the connection is OK and sometimes, it returns -10 (Connection KO).

Is anybody has a idea of my problem? Thanks a lot
0 Kudos
Message 1 of 6
(4,257 Views)

rather than fix the problem it maybe easier to work around the problem.

once you detect that there is no network, stay in that mode untill you have a reboot/restart of program.

you were not clear on how you are detecting loss of network. Are you using the SQL call to determine that.If so do it another way.

Type to open a file that you know is only on the network. In fact place a file in a know place on the network and look for it.

we used a file called "network.$$$"

 

 

 

- Make Software User Friendly -
0 Kudos
Message 2 of 6
(4,246 Views)

Thank you a lot, rorOttawa

I think you are right, it would be easier to limit my program in the local mode once the network was removed. We should  restart it again to return in the normal mode.

In fact, to detect network connection, I have a function ConnectDatabaseServer in which I call "DBConnect" using a request: name of the file .mdb + the password.

Then, the return value is used as DB Handle for the following operations. And it is this value which becomes random after removed the cable.

I will test your method immediately, thank youSmiley Wink

0 Kudos
Message 3 of 6
(4,242 Views)
You could also ping your server using InetPing command in the Internet library.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(4,236 Views)
by the way ,i only have sql labview toolkt,
how can i get sql cvi toolkit? can i get it by free?
Sonic

Diffrent Strokes for Different Folks
0 Kudos
Message 5 of 6
(4,213 Views)
As you can see in this page, the former sql toolkit is now packed together with some other software toolkits into the Entrerprise connectivity toolkit. I suggest you to contact your local NI representative to see if based on your existing software you can get acces to some upgrade offer and / or facility (for example we have choosen to subscribe a Developer Suite which offers several additional toolkits both for CVI and LV)


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(4,203 Views)