By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,534 Members | 2,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,534 IT Pros & Developers. It's quick & easy.

run simple SQL code from within a query

P: n/a
Guys:

An ACCESS-newbie is knocking the door ...

I am wondering whether it is possible to run a simple SQL code to add
an autonumber field from within a Make-Table query.

Right now I am doing this in two steps:

1. run the Make-Table query to create a table - tb_temp
2. write a macro with just one RunSQL action, and the SQL statement is

Alter table tb_temp ADD column ID autoincrement

It will be nice if I could do them using one step

Another related question is that the ID column is added as the last
field of the table. Is there an easy way to move it to be the first
field without doing it manully or using another make-table query?

Thanks,
Haipeng

Jun 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
sh*********@gmail.com wrote in
news:11*********************@i40g2000cwc.googlegro ups.com:
Guys:

An ACCESS-newbie is knocking the door ...

I am wondering whether it is possible to run a simple SQL code
to add an autonumber field from within a Make-Table query.

Right now I am doing this in two steps:

1. run the Make-Table query to create a table - tb_temp
2. write a macro with just one RunSQL action, and the SQL
statement is

Alter table tb_temp ADD column ID autoincrement

It will be nice if I could do them using one step

Another related question is that the ID column is added as the
last field of the table. Is there an easy way to move it to be
the first field without doing it manully or using another
make-table query?

Thanks,
Haipeng

Just do a maketable query that puts the autonumber as the first
field.

CREATE Table tb_Tmp (PKfield autoincrement constraint PKfield
primary key, Txt1 text(25), num1 long);

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.