By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,233 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

how i reset auto increament number during rollback transaction

P: 1
hi

i am using access 2000 and vb 6 as front end

i have used auto increament number field in one of the my talble
during some error the transaction will rollback but auto number in a table will skiped

please suggest

regards

Prasannashet
Jan 2 '07 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
Hi,

Usually the autoincrement can't be restored from the ordinary tools in Access!

But there is a way to do it!

Imagine u have a table named MyTable
And

ID as autoincrement Field that is also indexed without dublicates?

Do u follow me? Think Yeah?

So u need to run a query like this to restore ur autonumber:

INSERT INTO MyTable(ID)
SELECT DISTINCT Max(ID)
FROM MyTable;

Don't worry that this query wouldn't append any record!

But ur autonumber will feel good when u begin to add new records! ;)
Jan 2 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.