Excel JDBC/ODBC "Syntax error in field definition"

Posted on 2005-04-04
Medium Priority
Last Modified: 2008-01-09
Hi experts,

In my Java program, I export results to an Excel sheet, using the jdbc-odbc bridge.
It always manages to connect (ie. create the xls file), but then when executing the Create statement, it fails sometimes,
 giving "java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error in field definition."

create table nameofTable (name TEXT, phone TEXT, amt TEXT, date TEXT, Status TEXT, Result TEXT, CallStart TEXT, CallEnd TEXT, Duration TEXT);

so once again:  connect statement always works.  create statement doesnt work sometimes, even though syntax is the same as when it does work.

sorry its so vague...  but any ideas?
Question by:dbrownell83
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 92

Accepted Solution

objects earned 2000 total points
ID: 13702808
Looks like some of your field names are reservered words (eg. date)
Try changing your field names, or try wrapping them in []  eg. [date]

Author Comment

ID: 13702899
thanks i knew it was something stupid
LVL 92

Expert Comment

ID: 13702922
stupid is such a harsh term :)

Author Comment

ID: 13702994
they won't let me write harsher terms, i dont think

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question