|
-
Oct 29th, 2001, 08:02 AM
#1
Thread Starter
Addicted Member
adox, creating tables, how to set autonumbering RESOLVED
hello,
i'm creating tables in an access database via ADOX.
i can create the tables, add fields to it (eg. integer, varchar, ...) , but now i want an autonumbering field.
how can i do this?
Last edited by c@lle; Oct 29th, 2001 at 09:46 AM.
-
Oct 29th, 2001, 09:36 AM
#2
Fanatic Member
' Create a new autonumber ID Column
Set col = New ADOX.Column
col.Name = "theColName"
col.Type = adInteger
col.ParentCatalog = cat 'cat is the catalog variable
col.Properties("Autoincrement") = True
cat.Tables("theTableName").Columns.Append col
VB 6.0, Access, Sql server, Asp
-
Oct 29th, 2001, 09:38 AM
#3
-= B u g S l a y e r =-
or u can use SQL ...
VB Code:
SQL = "ALTER TABLE Table1 ADD COLUMN ID COUNTER"
cnn.Execute SQL
-
Oct 29th, 2001, 09:45 AM
#4
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|