LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL query data Excel

Hi Team

 I have a task in which Test reports are entered in Microsoft Access.I'm familiar in entering data into Database, and how to generate SQL Query.  next part of the work is that I should export Generated SQL Query recordset (via Labview with running SQL query) to Excel. Please help me in this matter. 

Find the image for code and SQL query

Download All
0 Kudos
Message 1 of 3
(3,384 Views)
There are some basic structural issues with you code, but the problem moving data to excel is with the data connectivity toolkit which returns the data as a 2D array of variants. By the way, the only thing inside each variant element is a string. The best long term solution is to dump the DCT and use drivers that handle data rationally.

Short term to fix this basic problem run the 2D variant array into two nested for loops. The outer-most loop will index rows, the inner loop will index columns within each row. Inside the inner loop convert the variant of o a string and run the result back out through the two loop boundaries. You will now have a 2D array of strings.

Pass that array to the the array to spreadsheet string function, write the result to a text file and you're done.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(3,357 Views)

....or just use the Database Variant to Data VI with a blank 2D string array wired to type.

Capture.PNG

aputman
0 Kudos
Message 3 of 3
(3,325 Views)