aspose file tools
The moose likes JDBC and Relational Databases and the fly likes Syntax error in INSERT statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Syntax error in INSERT statement" Watch "Syntax error in INSERT statement" New topic

Syntax error in INSERT statement

K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68

im getting syn
"java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driv
er] Syntax error in INSERT INTO statement."

while running the above. code. any body help me with this problem
[ July 21, 2006: Message edited by: K Vidhyakar ]
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Check your field data types (such as eid,timeIn, timeOut). Are all your field of the type Text in your table?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19345

"Date" is a reserved word in MS Access (which I guess you may be using) and probably in other databases too. Changing the column name to something more precise would, as a side effect, improve your database design.
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 68
they i changed the field name date to edate. now its working.
thanks a lot friends.
amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
check the DNS name which should be created as company while connecting to MS sql server.

Thanks advance who ever answers this question.

amit bhadre
I agree. Here's the link:
subject: Syntax error in INSERT statement