07-13-2011 02:50 AM
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.
Solved! Go to Solution.
07-13-2011 03:22 AM
Can't promise anything, but if you can back-save to version 8.2 I'll have a tinker...
Ian
07-13-2011 03:56 AM
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;))
07-13-2011 04:36 AM
attached is the table.
i created the table by default value. so it must have been in char.
07-13-2011 04:42 AM
here is the 8.2 version.
i have also attached the DB in the zip.
Thanks in advance.
07-13-2011 04:53 AM
"date" is a reserved word for Access.
Did you enclose the field name (not value) with ' or [ ? (example:
'date'
or
[date]
07-13-2011 05:12 AM
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
07-13-2011 08:39 AM
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
07-13-2011 11:58 PM
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.