LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Toolkit memory problem

I am having a problem quering data using the SQL Toolkit. I open a connection and then query data (100 records) and close the connection, if I execute this loop once I have no problems, but if I loop this 40 times my PC will locks up after the 36th loop. I don't know if this could be memory leak issue or not. I thought that if you close the connection and reopen a new one that the memory would be reset. How can I get around this problem?

Thanks for any help,

Price1
0 Kudos
Message 1 of 4
(2,964 Views)
Hi

I had also problems with SQL toolkit, and what I found out is that all problems come from the open (or closed automatically) references to the dataset you query from database. It is very important that you close all opened connections (including dataset, not only connection id) before closing the vi, especially if they run in a loop.

hope it helps
Pawel
0 Kudos
Message 2 of 4
(2,955 Views)
Thanks for the help! This has pointed me in the right direction.

But I am still puzzled why the (DB tools free object.vi), which deletes the recordset object
even if it is run in a loop. I attached a simple vi that I created to test the database.
I am using the LabView Database Connectivity Toolset 1.0.1.

Thanks again for the help,

Price1
0 Kudos
Message 3 of 4
(2,945 Views)
Hello Again

From what I can see:
1. you do not need to open and close a connection to database (as long as a reference exists in the memory). You can open a reference to a connection (by means of "DB Tools Open Connection" before the loop, or event structure, and close it afterwards.
2. In the correct way you are closing the recordset reference. It is opened every time by "DB tools Execute Query" and it must be closed after you fetch the data.

good luck.
Pawel
0 Kudos
Message 4 of 4
(2,931 Views)