LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easier way to do database insertion?

Hi,

I've been trying to use the parameterized query system to enter data into a MS Access database. At first I tried using the simple Database Insert.vi, but I am dealing with a table with 50+ columns of differing data types and using a cluster with 50+ nodes is a big mess. Now I'm trying to use the parameterized query system to do my data insertion. This seems to do the job easier, but I'm dissatisfied with the method of entering the parameter items needed to complete the insertion. I followed the example included in the Database Connectivity Toolset. I'm using the front panel parameter control (parameter name, data type, direction) to set the parameter items for the query. I'm looking for a better way to set the param
eter items for the query. I don't like using the front panel control because changing the query involves erasing the parameter array and starting over. Doing that for 50+ columns is tedious.

Thanks in advance!
0 Kudos
Message 1 of 2
(2,437 Views)
The first thing I'd look at is the database itself. A single table with 50+ columns is really, really big. If you have to provide that much stuff for a single insert, perhaps the data structure isn't normalized enough. Many times running into something that is a real pain to do is a good indication that you are heading in the wrong direction.

Something I have done in the past is to use the ADO activex control to execute SQL statements. I create an insert VI that has the input data structure on it's front panel. The data from the data structure in formatted into a SQL "insert" statement 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 2
(2,437 Views)