LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use activex insert arry data into sql?

i use ADODB_connect to open the databse .now i want to insert some array data into the database.so i link the array to ADODB_recordset(addnew),if the array have nothing data ,the system will not prompt any error.
 
 
Download All
0 Kudos
Message 1 of 3
(2,894 Views)

hi there,

if the array is empty the code inside the for loop isn't executed at all (because there's no data to handle!). this is called "Auto indexing" of a for loop (see LV documentation for more details). so in this case you just open the recordset and close it afterwards without doing anything with the recordset. thus there is no error code.

only if you pass a non-empty array you actually touch the recordset obhect. i'm not sure, but maybe you need to call the "update" method after the last "AddNew" (i.e. after the for loop) to actually write the data to the recordset.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 3
(2,891 Views)

i read the microsoft ADO explain,it said updata  would used after addnew .i don't now how to user adobb_recordset to insert a array data .in my example,if the array have any data .the error would occured after  the first addnew invonk node.may be the fieldlist not match the values.

who can make a sample?

0 Kudos
Message 3 of 3
(2,880 Views)