Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Records not maintaining their Natural Order of entry


Message #1 by <ccoutinho@n...> on Thu, 23 May 2002 16:10:52 SAU
I have a Table against which I have not default sorting order or indexes 
created.
When I enter a record at Record number 109 into the table and then close the 
table and reopen it, I find the record positioned at record position  number 
35.

I want my records to maintain their natural order as entered. 

Any help on this would be greatly appreciated.

Regards,

Chris
Message #2 by braxis@b... on Thu, 23 May 2002 14:34:14 +0100 (BST)
Chris

First things first - what you're trying to do is a BAD THING from a relational database point of view and would be FROWNED UPON by
any database theorists. A table is just a random collection of records, which could, theoretically, be returned in a different order
each time you look at the table!

Best practice would be to construct a query which returns the records in the order you require. You may need to add a creation date
field to your table to get this to work.

You could try adding an autonumber key to the table - which will work perfectly, until someone converts your database to a replica
set and your autonumber field becomes random rather than sequential.

Hope this helps

Brian

>  from:    ccoutinho@n...
>  date:    Thu, 23 May 2002 17:10:52
>  to:      access@p...
>  subject: Re: [access] Records not maintaining their Natural Order of entry
> 
> I have a Table against which I have not default sorting order or indexes 
> created.
> When I enter a record at Record number 109 into the table and then close the 
> table and reopen it, I find the record positioned at record position  number 
> 35.
> 
> I want my records to maintain their natural order as entered. 
> 
> Any help on this would be greatly appreciated.
> 
> Regards,
> 
> Chris
> 

Message #3 by "Leo Scott" <leoscott@c...> on Thu, 23 May 2002 08:32:58 -0700
This is very correct, but if you must have the order entry, i.e., record
creation entry, then add an Autonumber field to the table and sort on that.
It will not always be consecutive numbers but it will always be in the order
of creation of the records.

|-----Original Message-----
|From: braxis@b... [mailto:braxis@b...]
|Sent: Thursday, May 23, 2002 6:34 AM
|To: Access
|Subject: [access] Re: Records not maintaining their Natural Order of
|entry
|
|
|Chris
|
|First things first - what you're trying to do is a BAD THING from
|a relational database point of view and would be FROWNED UPON by
|any database theorists. A table is just a random collection of
|records, which could, theoretically, be returned in a different
|order each time you look at the table!
|
|Best practice would be to construct a query which returns the
|records in the order you require. You may need to add a creation
|date field to your table to get this to work.
|
|You could try adding an autonumber key to the table - which will
|work perfectly, until someone converts your database to a replica
|set and your autonumber field becomes random rather than sequential.
|
|Hope this helps
|
|Brian
|
|>  from:    ccoutinho@n...
|>  date:    Thu, 23 May 2002 17:10:52
|>  to:      access@p...
|>  subject: Re: [access] Records not maintaining their Natural
|Order of entry
|>
|> I have a Table against which I have not default sorting order or indexes
|> created.
|> When I enter a record at Record number 109 into the table and
|then close the
|> table and reopen it, I find the record positioned at record
|position  number
|> 35.
|>
|> I want my records to maintain their natural order as entered.
|>
|> Any help on this would be greatly appreciated.
|>
|> Regards,
|>
|> Chris
|>
|
|

Message #4 by <ccoutinho@n...> on Fri, 24 May 2002 7:12:04 SAU
Brian / Leo

Thanks for the Input.
I have now used a date time field to maintain records in their natural order 
of entry.

Thanks again,

Chris


---------- Original Text ----------

From: <braxis@b...>, on 5/23/02 4:34 PM:

Chris

First things first - what you're trying to do is a BAD THING from a 
relational database point of view and would be FROWNED UPON by any database 
theorists. A table is just a random collection of records, which could, 
theoretically, be returned in a different order each time you look at the 
table!

Best practice would be to construct a query which returns the records in the 
order you require. You may need to add a creation date field to your table to 
get this to work.

You could try adding an autonumber key to the table - which will work 
perfectly, until someone converts your database to a replica set and your 
autonumber field becomes random rather than sequential.

Hope this helps

Brian

>  from:    ccoutinho@n...
>  date:    Thu, 23 May 2002 17:10:52
>  to:      access@p...
>  subject: Re: [access] Records not maintaining their Natural Order of entry
> 
> I have a Table against which I have not default sorting order or indexes 
> created.
> When I enter a record at Record number 109 into the table and then close the 
> table and reopen it, I find the record positioned at record position  number 
> 35.
> 
> I want my records to maintain their natural order as entered. 
> 
> Any help on this would be greatly appreciated.
> 
> Regards,
> 
> Chris
> 



Message #5 by "David Chapman" <luckychap@b...> on Fri, 24 May 2002 19:46:16 +0930
Chris,

Relational databases are not designed this way but I appreciate there could
be a reqiurement. A couple of points come to mind.
Access automatically creates indexes. I know you have said you did not
create indexes but make sure Access has not created indexes. In table design
view, Click the index icon on the menu bar. If there are indexes and you
want you want to turn the auto indexing feature off then search through
options and check help - it can be done if you want to.

David

-----Original Message-----
From: ccoutinho@n... [mailto:ccoutinho@n...]
Sent: Friday, May 24, 2002 1:41 AM
To: Access
Subject: [access] Records not maintaining their Natural Order of entry


I have a Table against which I have not default sorting order or indexes
created.
When I enter a record at Record number 109 into the table and then close the
table and reopen it, I find the record positioned at record position  number
35.

I want my records to maintain their natural order as entered.

Any help on this would be greatly appreciated.

Regards,

Chris



  Return to Index