Access db autonumber
-
I amhaving problems with my db connection. In a form connected to the db through a table adaptor if i restore using CancelEdit, and then add new again the dataset retains the next sequential autonumber. i.e addnew id is 79, restore, addnew id is 80, when no 79 was actually created in the access db. I have tried restore etc to no avail. How can i reset the dataset to match the current autonumbers in the db. Thanks
-
I amhaving problems with my db connection. In a form connected to the db through a table adaptor if i restore using CancelEdit, and then add new again the dataset retains the next sequential autonumber. i.e addnew id is 79, restore, addnew id is 80, when no 79 was actually created in the access db. I have tried restore etc to no avail. How can i reset the dataset to match the current autonumbers in the db. Thanks
First - why do you care what happened to ID 79 as long as the record was not saved. Second - learn about ID fields, they should not have a use other than identifying the record. If your system is failing because there is no 79 you are using 79 for other than id. STOP. This is a classic mistake all new programmers encounter.
Never underestimate the power of human stupidity RAH
-
First - why do you care what happened to ID 79 as long as the record was not saved. Second - learn about ID fields, they should not have a use other than identifying the record. If your system is failing because there is no 79 you are using 79 for other than id. STOP. This is a classic mistake all new programmers encounter.
Never underestimate the power of human stupidity RAH
The reason i care :P is that when you try to delete the newly created record it uses the id as its Id into the back end (Db), there is no match so i get an error every time. so 79 in the dataset is actually say 77 in the Access db (Autonumber). In an ideal world this wouldn't happen however.. BTW yes i am new (trying to self teach) but am aware that an id is just that, a record placer.