AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL CREATE TABLE ERROR

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Ben
Guest





PostPosted: Tue Apr 25, 2006 11:12 pm    Post subject: SQL CREATE TABLE ERROR Reply with quote



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.
Back to top
Bjorn Abelli
Guest





PostPosted: Wed Apr 26, 2006 3:12 am    Post subject: Re: SQL CREATE TABLE ERROR Reply with quote



"Ben" wrote...

Quote:
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...

Quote:
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.

Quote:
Long Integer and Memo.

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

"Integer" and "Memo" respectively...

// Bjorn A



Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.