12-12-2017 04:20 AM
12-12-2017 09:32 AM
Hello aputman,
I've tried what you suggested but unfortunately it didn't work and I still get the same error.
As for what you suggested Sam, I can't do that because my values are generated by the DaqAssistant.
12-12-2017 09:49 AM
I never tried the syntax suggested by Sam, but certainly you can reproduce it modifying the code in your loop.
The string "INSERT INTO table (value,name) " should be injected into the shift register, then you should add your value pairs properly.
12-12-2017 09:53 AM - edited 12-12-2017 09:56 AM
You have misunderstood what I suggested, in your for loop, you generate N queries (one for each channel). Instead of that, generate a single query with N VALUE sections, like this:
It has the exact same structure as your existing code but does the inserts in a single query.
12-12-2017 10:10 AM
I'm sorry I didn't understand you at the beginnig, I tested that and I have the same string query as you showed me. But now I have an error that says that "Column count doesn't match value count at row 1". I'd like to inform you that my database table has two columns (value & channels).
12-12-2017 10:22 AM
Try your question in the database, e.g. SQL manager, and/or build the question there as a reference to how you need to formulate it in LV.
/Y
12-12-2017 10:24 AM
It seems like the decimal separator where the problem was, I added %.; to my query and now it works.
Thank you so much for your help, I really appreciate.
12-12-2017 11:30 AM
@AhciaDa wrote:
Hello aputman,
I've tried what you suggested but unfortunately it didn't work and I still get the same error.
As for what you suggested Sam, I can't do that because my values are generated by the DaqAssistant.
Well, of course it won't work if you don't incorporate all of the advice you have been given.
12-12-2017 12:37 PM
I did incorporate them and it works well now.
Thank you very much.
11-05-2019 02:29 AM
Hello,
I try to insert multiple values in .mdb database using standard microsoft jet oledb connection.
My query is:
INSERT INTO T_Column (C_Name)
VALUES ('1') , ('2');
I use NI_Database_API.lvlib: DB Tools Execute Query.vi
I get the error -2147217900: "
L'erreur -2147217900 s'est produite à : NI_Database_API.lvlib:Conn Execute.vi->Add_Multiple_Columns_onDatabase.vi->Test_Create_big_database_optim.vi
Raisons possibles :
ADO Error: 0x80040E14
Exception occured in Microsoft JET Database Engine: Point-virgule absent à la fin de l'instruction SQL. dans NI_Database_API.lvlib:Conn Execute.vi->Add_Multiple_Columns_onDatabase.vi->Test_Create_big_database_optim.vi"
It indicates that the semicolon character is missing in the query...
I think that I can not execute multiple query because the request below works:
INSERT INTO T_Column (C_Name)
VALUES ('1') ;
What do I have to do to correct this?
I really need help urgently! Thanks for your help!