Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jdbc/odbc create table with autonumber field .. 3

Status
Not open for further replies.

omanthey

Programmer
Feb 20, 2003
3
DE
hello,

i just tried to create a new table from my java application using jdbc/odbc connectivity and the following sql statement

CREATE TABLE ENVIRONMENT (id AUTONUMBER, name VARCHAR)

unfortunately i always get the following exception ...

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in CREATE TABLE statement.

can anybody help me ...

thx
 
Can't tell you a work around but it seems to be bombing on the autonumber type. If I design a query and look at an autonumber field, it's datatype is long integer and it has new value property of increment. I don't think you can get at the new value property via Jet-SQL and hence ODBC/JDBC.
 
Have you tried this yet?

create table environment (id autoincrement, name varchar);
 
muneco,

It executes withing Access.

Where did you get the right datatype? I couldn't seem to find datatypes for createtable in help (Access 97).
 
Actually, I found it here on Tek-Tips.

I have a RDBMS background but I am new to Access 2000 and this forum has been a great help. More often than not, if I do a search by keyword on this forum, I am pointed in the right direction.

Regards...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top