LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does the ADO connection persist after the VI is run ?

I wrote a 6.1 VI to connect to an MS Access database (see attachment) and to check on subsequent calls to see if a connection is open. I check on the connection by linking the connection reference to a local variable and using the Get Connection Properties VI to see if it is still open. Every time I run the VI the connection referenced by the local variable is not open and another call is made to open the connection.
Why isn't the connection reference stored in the local variable returning a connection open condition ?
Am I openining multiple connections to the database ?
0 Kudos
Message 1 of 3
(2,279 Views)
It seems like the LabVIEW developers have built some features into LabVIEW to protect against the memory leaks and other problems which often result from not closing ActiveX refnums. The refnums now seem to be closed when the application completes execution. This should only be a problem for you if you are letting the application complete execution and then try running it again. If the application is still active, the refnums should remain open. For example, if you take your VIs diagram and drop it ia a loop such that it executes twice, it behaves the way you expected it.
Message 2 of 3
(2,279 Views)
Thanks for the input. I had the exact same problem and this answers my question.
0 Kudos
Message 3 of 3
(2,279 Views)