From: astroboy on
Hi I am not familiar with ADO DB connection.
I am using Labview 7.1, MySQL and LabSQL.
To get LabSQL and MySQL, you can find <a href="http://jeffreytravis.com/lost/labsql.html" target="_blank">http://jeffreytravis.com/lost/labsql.html</a>&nbsp;and <a href="http://dev.mysql.com/downloads/mysql/4.1.html" target="_blank">http://dev.mysql.com/downloads/mysql/4.1.html</a>.
&nbsp;
In those LabsQL vi functions, there are no vi descriptions for connections.
I tried finding&nbsp;similar descriptions to compare from ADO websites.&nbsp;I am getting confused.
&nbsp;
Here are LabSQL vi functions:-
1) ADO Connection Create.vi - means&nbsp; Create an connection to database?
2) ADO Connection Open.vi - means Open the connection to database?
3) ADO Connection Close.vi - means Close the connection&nbsp; to database?
4) ADO Connection Destroy.vi - means Destroy the connection to database?
Are ADO Connection Close and Destroy same?
&nbsp;
And I am not familiar with the sequence of those vi.
For eg. I read&nbsp; the procedure from <a href="http://www.w3schools.com/ado/ado_intro.asp" target="_blank">http://www.w3schools.com/ado/ado_intro.asp</a>
Accessing a Database from an ASP Page
The common way to access a database from inside an ASP page is to:

- Create an ADO connection to a database
- Open the database connection
- Create an ADO recordset
- Open the recordset
- Extract the data you need from the recordset
- Close the recordset
- Close the connection

So when I cannot find LabSQL functions for eg Open recordset and close recordset, so what is the equivalent ADO function to "destroy the connection"?
And here are my attached, and I there's something i do not understand,
And my question for my attached, typing my show processlist in command prompt,
When run attached for the first time, "show processlist" command&nbsp;show no host to "test" db.
when click to open database, "show&nbsp; processlist" command shows my host&nbsp; to "test" db.
When click to close database, "show&nbsp; processlist" command still shows my host&nbsp; to "test" db.
Why is this so? By right, there should be no sign of "test" db. Do i have to use ADO Connection Destroy vi to destroy connection?
&nbsp;
Please advise
Thanks


testdb_connection.vi:
http://forums.ni.com/attachments/ni/170/312300/1/testdb_connection.vi
From: astroboy on
Hi Van_L and Smercurio_fc,
Thanks for your advices.
Now I undesrtand better.
clement
From: astroboy on
Hi Smercurio_fc,
Show processlist is actually a command used in MySQL that will show you the actual connection threads to the&nbsp;various databases.
So that we will know how many actual and duplicated connections we have. Using this, we can determine whether&nbsp;our LV program&nbsp;has actually closed the connection based on the number of open connections, so that it will not lead to error such as "Too many connections" that runs out of the max number of connections as set.
&nbsp;
Clement
&nbsp;
From: smercurio_fc on
OK, thanks for the info. Sounds like the MySQL version of SQL Profiler that comes with SQL Server.
From: EWTech on
There are other possibilities. I built a dll project in Visual Studio and used the dll Constructor Node and Invoke Node&nbsp;fuctions in LV 8..5.1 to attach to the dll file. It saves to a separate database using ADO.NET rather than the ADO functions built into LabSQL. It requires a bit more effort in some ways but it's very flexible. I'm not sure what there is in LV 7 but these fuctions seem to be in 8.2.1 as well.