problem in adding records after deleting some records
-
Hi, I have a problem in listing all records in my mdb file. steps. 1. I made a mymdb.mdb file. 2. added some records. 3. deleted some records. 4. added new records. 5. repeat 2,3,4 steps several times. Finally, when I list all the records in mdb file - I used MoveFirst(), read record and MoveNext() until all the records were populated. - the added records in 4th step were inserted somewhere near the deleted records in 2nd step. I don't know exactly this behavior is caused my code or it is a nature of mdb. I want to place the new records always in the last of the mdb. How can I do that? Thanks.
-
Hi, I have a problem in listing all records in my mdb file. steps. 1. I made a mymdb.mdb file. 2. added some records. 3. deleted some records. 4. added new records. 5. repeat 2,3,4 steps several times. Finally, when I list all the records in mdb file - I used MoveFirst(), read record and MoveNext() until all the records were populated. - the added records in 4th step were inserted somewhere near the deleted records in 2nd step. I don't know exactly this behavior is caused my code or it is a nature of mdb. I want to place the new records always in the last of the mdb. How can I do that? Thanks.
Wormhole5230 wrote: I don't know exactly this behavior is caused my code or it is a nature of mdb this is a nature of any DBMS.. you have no control over the physical order of records in a datafile..(Unless you make a clustered index in sql server but event in this case i'm not sure about the order)Access and SQL Server fill the space marked for deletion with new records.. need a solution ? add an Autonumber field and let your queries end with (
Order By ID
) ;P