a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Access Database

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Access Database
Page: [1]
 
nay27uk

 

Posts: 282
Joined: 5/13/2003
From: leicester uk
Status: offline

 
Access Database - 11/19/2004 13:02:54   
Hi all

in an access database when you have a primary key in my case the primary key is a field called UserID
If you delete anything from the database is ther any way to get the primary key back to the following number.

Example if i removed UserID 1 how can i get the database to add a new record as UserID 2 instead of somthin else

_____________________________

REGARDS
NATHAN
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Access Database - 11/19/2004 13:34:56   
In Access, a PK by definition doesn't force the number, it is the type AutoNumber that forces the increments. The PK requirements just force the field to be unique IIRC.

To always use the next available number in a sequence, you'd have to set the field back to just an integer and somehow check for uniqueness. I would highly advise against this; it's far too easy and convenient to keep the field AutoNumber and be assured of maintaining "uniqueness".

If you really want the User ID to be sequential, you'd need to set up a separate UserID field and check the numbers for gaps each time you added a user.

This is probably far more trouble than it's worth IMO. May I ask why you must have them all sequential?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to nay27uk)
nay27uk

 

Posts: 282
Joined: 5/13/2003
From: leicester uk
Status: offline

 
RE: Access Database - 11/19/2004 13:39:26   
No point really just in admin.asp it shows this field and i kinda thought it would look more tidy than jumping from say UserID 1 to UserID 50 ECT ECT

_____________________________

REGARDS
NATHAN

(in reply to rdouglass)
caz

 

Posts: 3626
Joined: 10/10/2001
From: Somewhere south of Chester, UK
Status: offline

 
RE: Access Database - 11/19/2004 14:51:33   
It can be done, but the question is do you really want to?
Look in the Access Help files and see KB 209696

You can be too tidy :)

_____________________________

Do not meddle in the affairs of cats, for they are subtle and will dance, or more on your keyboard.
Cheshire cat. www.doracat.co.uk

I remember when it took less than 4hrs to fly across the Atlantic.

(in reply to nay27uk)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Access Database - 11/19/2004 15:46:49   
quote:

and see KB 209696


Really didn't want to suggest that route.....:):):)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to caz)
caz

 

Posts: 3626
Joined: 10/10/2001
From: Somewhere south of Chester, UK
Status: offline

 
RE: Access Database - 11/20/2004 7:15:30   
quote:

ORIGINAL: rdouglass

quote:

and see KB 209696


Really didn't want to suggest that route.....:):):)


Yes, for emergency use only...with fingers and toes crossed.
:):):):)

_____________________________

Do not meddle in the affairs of cats, for they are subtle and will dance, or more on your keyboard.
Cheshire cat. www.doracat.co.uk

I remember when it took less than 4hrs to fly across the Atlantic.

(in reply to rdouglass)
nay27uk

 

Posts: 282
Joined: 5/13/2003
From: leicester uk
Status: offline

 
RE: Access Database - 11/20/2004 11:59:52   
Thanks all think i will just leave it as it is and make a brand new database when i submit the GB to the public

_____________________________

REGARDS
NATHAN

(in reply to caz)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> Access Database
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts