Problem 2:
In order to be able to start from 1 after you've deleted all records from
the table you have to compact the database. The compact procedure will
remove all the blank space held by the deleted items.
Problem 1:
You set a primary key on a table with the intention not to change it later.
If you change you primary key, you may cause problems in the link with other
tables which are using this key as foreign key. Think about the amount of
work your program will have to do in order to update the auto-increment
fields in all related tables. If you really want to do this, I advise you
not to use the auto-increment field as primary key. Create your own field
for the primary key and create another field for the record number which you
have to maintain in your codes.
-----Original Message-----
From: Nicolas Raitman [mailto:new_world@r...]
Sent: Thursday, September 28, 2000 8:59 PM
To: professional vb
Subject: [pro_vb] Database Design II
Hi to all. I have another question on Database Design. Supose that I
have a table and it's primary key as autoincrement. It all works ok,
I add fields until I have 10. No matter why, but I decide to delete the
field number 3, and the next time that I will add the record, the fields
will remain the same, I mean even though I deleted one, is not that all
the fields will decrease by one. I guess this is right, but is there a
way to achieve this?
Also, I have another problem. The previous one was not that critical for
my needs, however, supose that I delete the entire table (I mean all the
records in the table), the field of the autoincrement, the next time that
I add another record will have the value of 11. I want that value to be
0, is there a way to do this?
Please I really need help in Database Design (the previous topic I
posted) because I cannot go on with my project if I can not create the
table I explained there.
Thanks a lot.