sql "create table" auto increment collumn?

  • Thread starter Fred Flintstone
  • Start date
F

Fred Flintstone

I have created script for creating all the required trables for a database
for MySQL, and am now trying to create the same scripts for Access.
Almost everything works, accept I can't find the syntax to create a table
that has an primary key with an auto_increment integer.
Does anyone know how to do this in Access by sending SQL command via an ODBC
connection?

ie :
create table test
field1 integer not nul auto_increment,
field2 varchar(20) default null,
prinary key field1
 
D

david epsom dot com dot au

I see that you misspelled Null & autoincrement: is that your
only problem?

(david)
 
F

Fred Flintstone

That was just me trying to get this post in quicly. It is spelled correctly
in the real script.
The scripts work against MYSQL database, but don't work on Access due to
syntacticle differences.
I have discovered all problems accept the autonumber / auto_increment. I
don't know how to do this with Access, without oppening the access file in
access and manually setting it.
I don't wan't to have to do it this way, as I am trying to create scripts as
part of an install routine, to create databases of any type ie: Mysql,
oracle, Sybase, SqlServer and for standalone use, Access.
 
D

Dave Laundry

Thats got it.
Thanks.

I sure wish database makers could agree on a common sintax.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top