Print Page | Close Window

Creating an Autoincrement

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7779
Printed Date: 30 March 2026 at 8:35am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Creating an Autoincrement
Posted By: fark
Subject: Creating an Autoincrement
Date Posted: 01 December 2003 at 4:59pm

For some reason my autoincrement doesn't work.  I copied this way of doing this from here:  http://www.flws.com.au/showusyourcode/codeLib/code/adox_makeTable.asp?catID=3 - http://www.flws.com.au/showusyourcode/codeLib/code/adox_make Table.asp?catID=3

Does anyone see what is wrong with my code?  Thanks

 Set objADOXDatabase = Server.CreateObject("ADOX.Catalog")

Set objFirstTable = Server.CreateObject("ADOX.Table")
  objFirstTable.Name = strTableName

  objFirstTable.Columns.Append "ColumnA", adInteger
  objFirstTable.Columns("ColumnA").Properties("Aut oincrement") = TRUE




Replies:
Posted By: ljamal
Date Posted: 01 December 2003 at 6:00pm
("Aut oincrement")?
("Autoincrement")


-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: fark
Date Posted: 02 December 2003 at 9:25am

Originally posted by ljamal ljamal wrote:

("Aut oincrement")?
("Autoincrement")

For some reason when I pasted the text in here it did that in my program it's actually:

objFirstTable.Columns("ColumnA").Properties("Autoincrement") = TRUE

Still not sure what's wrong with it?  Thanks Though.



Posted By: fark
Date Posted: 02 December 2003 at 9:43am

GOT IT

Before I can access that property I have to link it to that table/column whatever you call it?  I found this (by pure luck) in a MSDN code example.  I don't understand how it all works but it does work now that I've set the parent cataloge.  Figured I'd post the solution for any searching something similar in the future.  Thanks for everyones help.

Set objADOXDatabase = Server.CreateObject("ADOX.Catalog")

Set objFirstTable = Server.CreateObject("ADOX.Table")
  objFirstTable.Name = strTableName

Set objFirstTable.ParentCatalog = objADOXDatabase

  objFirstTable.Columns.Append "ColumnA", adInteger
  objFirstTable.Columns("ColumnA").Properties("Aut oincrement") = TRUE




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net