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

Query and AutoNumber

P: n/a
Hi all,

I need a query, on a VB6 application, to create a new table with an
''AutoNumber" Field but I cannot find the correct syntax.
This one doesn't work:

sQuery = "CREATE TABLE sTableName "
sQuery = sQuery & "("
sQuery = sQuery & "IDRecord AutoNumber NOT NULL "
sQuery = sQuery & ");"

Using 'LONG' instead of 'AutoNumber' works, but it's not what I mean
it to be.
Can someone help me?

Thanks in advance.
Marco
May 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hello Marco

The following sql works as a ddl query in Access 2003:

create table my_table (my_column counter not null)

Don't have VB6 so haven't tried it there.
Regards
Breadon

May 8 '07 #2

P: n/a
On Tue, 08 May 2007 13:17:16 +0200, MarcoEffe <ch******@tin.itwrote:

How about using DAO instead. This article describes it:
http://www.mvps.org/access/tables/tbl0016.htm
And bookmark that site!

-Tom.

>Hi all,

I need a query, on a VB6 application, to create a new table with an
''AutoNumber" Field but I cannot find the correct syntax.
This one doesn't work:

sQuery = "CREATE TABLE sTableName "
sQuery = sQuery & "("
sQuery = sQuery & "IDRecord AutoNumber NOT NULL "
sQuery = sQuery & ");"

Using 'LONG' instead of 'AutoNumber' works, but it's not what I mean
it to be.
Can someone help me?

Thanks in advance.
Marco
May 8 '07 #3

P: n/a
On 8 May 2007 06:58:13 -0700, breadon <br********@yahoo.co.ukwrote:
>Hello Marco

The following sql works as a ddl query in Access 2003:

create table my_table (my_column counter not null)

Don't have VB6 so haven't tried it there.
Regards
Breadon
Thanks a lot, now it works fine.

Regards
Marco
May 8 '07 #4

P: n/a
On Tue, 08 May 2007 07:20:10 -0700, Tom van Stiphout
<no*************@cox.netwrote:
>On Tue, 08 May 2007 13:17:16 +0200, MarcoEffe <ch******@tin.itwrote:

How about using DAO instead. This article describes it:
http://www.mvps.org/access/tables/tbl0016.htm
And bookmark that site!

-Tom.

Sorry but I have to stick to sql for this application.
And yet I should try and learn DAO, while I'm still in deep troble
with Acess SQL.

Regards
Marco
May 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.