Update autonumber field in Access Database

This is a discussion on "Update autonumber field in Access Database" within the Databases section. This forum, and the thread "Update autonumber field in Access Database are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Aug 20th, 2004, 08:00
Junior Member
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Update autonumber field in Access Database

I have a autonumber field in my Access Database, but it seemed that it can't be updated. I'm using Dreamweaver MX with the update record behavior. Is it possible to update an autonumber field?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Aug 20th, 2004, 08:10
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,184
Blog Entries: 7
Thanks: 27
Thanked 21 Times in 18 Posts
Hi Redkyna...

Autonumber fields are automatically generated by Access... they are controlled by access only. They cannot be changed once assigned.

Use a primary key that is a number field, and manually assign ID's if you want to be able to update them.

Do a search on these forums for autonumber field, for more info.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Aug 20th, 2004, 08:33
Junior Member
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Rob.The reason why i want to keep it to an auto number is that i have also include a page to insert new records to the same database where the ID will have to increase for every new record. Any solution?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Aug 20th, 2004, 09:18
Rob's Avatar
Rob Rob is online now
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,184
Blog Entries: 7
Thanks: 27
Thanked 21 Times in 18 Posts
If your solution calls for record ID's being incremental and there is no flexibility within that specification, then sure, the autonumber is the way to go (and is ideal for almost all situations)

I cannot understand WHY you would want to change a record ID once you have have added a record, but should this functionality be needed, then you will need another way of uniquely identifying records. One method could be to go down the path of using GUID's (Globally Unique IDentifier)

One (as far as I know undocumented) way of generating a GUID is by using an object I discovered when trawling my registry (yeah, I have way to much time on hands).

For your information, A GUID represents a Unique identifier - you cannot generate the same GUID
more than once. A GUID has a very low (next to impossible) probability of being duplicated again in the next 50 years.

To generate your GUID, use this code:
Code: Select all
Set ObjGUID = CreateObject("event.util")
MyGuid = objGUID.GetNewGUID()
Set ObjGUID = Nothing
You can then assign the contents of MyGuid to your primary key field.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
update, autonumber, field, access, database

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Memo Field sarahrobin Databases 0 Feb 13th, 2007 08:15
Access date field - update as record is updated matrixbrawl Databases 0 Jan 10th, 2007 09:58
Access Autonumber Start Value redkyna Databases 2 Aug 25th, 2004 06:08
Access Autonumber redkyna Databases 2 Aug 24th, 2004 09:37
Ms Access.... Custom Autonumber Format tycoon Databases 9 Apr 19th, 2004 17:19


All times are GMT. The time now is 23:12.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42