05-23-2007 03:52 AM
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
05-23-2007 07:35 PM
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.$$$"
05-24-2007 03:23 AM
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 you
05-24-2007 04:11 AM
05-27-2007 08:30 PM
05-28-2007 01:49 AM