Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Creating an Autoincrement
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Creating an Autoincrement

 Post Reply Post Reply
Author
fark View Drop Down
Newbie
Newbie


Joined: 04 November 2003
Location: United States
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote fark Quote  Post ReplyReply Direct Link To This Post Topic: Creating an Autoincrement
    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_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

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2003 at 6:00pm
("Aut oincrement")?
("Autoincrement")
Back to Top
fark View Drop Down
Newbie
Newbie


Joined: 04 November 2003
Location: United States
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote fark Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
fark View Drop Down
Newbie
Newbie


Joined: 04 November 2003
Location: United States
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote fark Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.