LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Entry into database

Solved!
Go to solution

 

I am attaching a code which does the task of entering the data into database(MS access) using ADO functions.

 

The MS access table name is provided during runtime.

 

When ever i run this vi, i get the error:

Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. in ADO Connection Execute.vi->SQL Execute.vi->inser into of resistance values in DB.vi

 

the ODBC access driver is already configured.

COuld anyone please tell me the reason.

Am so desperate for an answer.

 

Thank you in advance.

 

Regards
Grugh Mike

Success is Everything !!
0 Kudos
Message 1 of 9
(3,343 Views)

Can't promise anything, but if you can back-save to version 8.2 I'll have a tinker...

 

Ian

0 Kudos
Message 2 of 9
(3,334 Views)

Hi,


Random thought. How have you declared the parameters while creating the table? Is it of type integer or char? If it is int remove the single inverted commas while passing the values. Can you give some details regarding how you created the table and its data types?

 

Regards,

Nitzz

(Kudos are always Welcome;)) 

0 Kudos
Message 3 of 9
(3,332 Views)

attached is the table.

 

i created the table by default value. so it must have been in char.

Regards
Grugh Mike

Success is Everything !!
0 Kudos
Message 4 of 9
(3,325 Views)

here is the 8.2 version.

i have also attached the DB in the zip.

 

Thanks in advance.

Regards
Grugh Mike

Success is Everything !!
Download All
0 Kudos
Message 5 of 9
(3,322 Views)
Solution
Accepted by topic author Grugh_Mike

"date" is a reserved word for Access.

Did you enclose the field name (not value) with ' or [ ? (example:

'date'

or

[date]

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 6 of 9
(3,313 Views)

It seemed to work for me.

Two things however:

1) Your database didn't have a 'details' table, so I created one.

2) I replaced your connection string with one that I normally use.

 

See the attached...

 

Does that help?

 

Ian

0 Kudos
Message 7 of 9
(3,304 Views)

Do you have any table named '1187739' ? Since that's where you try to enter the data.

 

The string you build up has a race condition due to the local, there's no guarantee you get the same result from both reads.

You never use this built string but the first mentioned query.

 

What i often do is copy the query string and create a new query in Access and test it in there. It's a good test to see that the query is sound to begin with.

 

/Y 

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 9
(3,288 Views)

Hey guys

 

I figured the answer out.

There was problem with one of my column names.

As pincpanther has figued it out, i omitted the name date and it worked perfectly fine.

 

BTW Thanks guys for all the suggestions.

 

Regards
Grugh Mike

Success is Everything !!
0 Kudos
Message 9 of 9
(3,269 Views)