Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access DB with Autonumber Field

Status
Not open for further replies.

ABinBoston

Programmer
Nov 6, 2001
22
US
I am running an InterDev application that links to a MS Access 2k database. If I add a new record, the autonumber field does not show. If I view the data in a grid view after adding a record, the grid does show the autonumber. How can I get the autonumber to appear in detail view after saving the record?

Thanks - Anthony
abinboston@aol.com
 
Never a particularly easy one this! Some databases make it a bit easier though (SQLServer has the @@identity value).

If there is something unique in the data being inserted, then you can issue another SELECT to re-fetch the data just inserted - construct a WHERE cluse to include all of the columns that make up the unique value. Of course, if the auto number is the only unique thing then you have a problem!

On other databases, you may write a stored procedure to perform the INSERT. The procedure would return the auto-number value back. I am not sure if you can 'call' VBA functions in your Access database via ASP code / ODBC - if you could then this could probably achieve the desired result. (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top