LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I get a class conflict between the Prepare SQL.vi and the Get Column Name.vi with the SQL Toolkit compatibility vis from the Database Connectivity Toolkit?

I have done extensive programming with the SQL Toolkit with LabVIEW versions through 6.1. My customer now wants to upgrade to Windows 7, so I am trying to upgrade to LabVIEW 2009 (my latest purchased version) using the Database Connectivity Toolkit, and the SQL Toolkit Compatibility vis. Everything seemed to be going okay with the higher level SQL operations, but I ran into trouble with the Get Column Name.vi. 

 

The pictures below show the problem. The original SQL Toolkit connected the Prepare SQL.vi with the Get Column Name.vi with a cluster of two references, one for connection, and one for sql. The new compatibility vis have a class conflict in the wire because the Prepare SQL.vi contains a cluster with connection, and command references, but the Get Column Name.vi expects a cluster with connection and recordset references. 

 

Old Toolkit.PNG

 

 

Toolkit Compatibility.png

How do I resolve this conflict?

 

Thank You.

Dan

 


0 Kudos
Message 1 of 5
(2,404 Views)

FreedomDan,

 

Check out this link I found for SQL compatibility with the Database Connectivity Toolkit.  I think it may help you with what you're doing.

 

http://digital.ni.com/public.nsf/allkb/1F8EF0F0196EAFFB8625745800700F67?OpenDocument

------------------------------------------------------------------------------------------

Jon F.
Technical Support Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,360 Views)

Thanks for your response, but my problem remains. Neither the "Get Column Name.vi", nor the "Prepare SQL.vi", which are the two vis showing the wire type conflict, are on the list of vis not replaced with the compatibility vis. Opening the _SQL folder, both of these vis are included in the compatibility vis, yet they will not connect to each other as they did in the original SQL Toolkit.

 

Thanks again.

Dan


0 Kudos
Message 3 of 5
(2,348 Views)

I've never worked with the old version of the toolkit, so I don't know how it did things, but looking inside the SQL prep VI, it only generates a command, and the the column name VI wants a recordset. I'm not super familiar with all the internals of ADO, but my understanding is that is standard - you only have the columns after you execute the command and get the recordset back. What you can apparently do here is insert the Execute Prepared SQL VI in the middle and that will return what you need.

 

I'm not sure why it worked before. Maybe the execute was hidden inside the prep VI or maybe you can get the column names out of the command object before execution. In general, I would recommend considering switching to the newer VIs.


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,334 Views)

Your suggestion worked like a charm. Thank you for the help. This super-complex development that has been on-going for more than a decade (hence the old version of SQL Toolkit) has now been updated and upgraded to run on Windows 7 machines. (I believe this program became a sentient life form in the late ninties!)

 

Thanks again.

Dan


0 Kudos
Message 5 of 5
(2,315 Views)