Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / April 2006

Tip: Looking for answers? Try searching our database.

SQL CREATE TABLE ERROR

Thread view: 
Ben - 25 Apr 2006 23:17 GMT
Hi,

Im trying to create a table in an access database using java.  When I
used "CREATE TABLE tblTable (time number)" it works fine.  However when
I try "CREATE TABLE tblTable (time number, to_place number)" I get the
following error.

ERROR: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
Syntax error in field definition.

What am I doing wrong?  Also, what is the datatype in SQL for number:
Long Integer and Memo.

Thanks.

Ben.
Bjorn Abelli - 26 Apr 2006 03:50 GMT
"Ben" wrote...

> Im trying to create a table in an access database using java.
> When I used "CREATE TABLE tblTable (time number)" it works fine.

It shouldn't, as TIME is a reserved word.

Look again at your script, as you probably spelled it just a little bit
differently...

> What am I doing wrong?

> Also, what is the datatype in SQL for number:

Using "Number" as datatype from SQL gives a "Double" in Access.

> Long Integer and Memo.

To create such fields in Access from Java, you can use the types:

"Integer" and "Memo" respectively...

// Bjorn A


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.