ASP / HTML Form + AutoNumber

Hi all,

I’m trying to create a form which, once filled in, submits it to the required email address, and into a database to record the submission.

I can achieve that, but I’d also like each form to have a unique ID, ie the AutoNumber in the database, and for that to be emailed to the address at the same time.

Does anyone have / know of any code to do this please?

For example, someone fills in form, they click submit, the details are entered into the DB, the AutoNumber is pulled back and all the details, with the AutoNumber are emailed to the person.

Any help would be greatly appreciated!

Thanks

You’d be looking at grabbing the @@identity or scope_identity()

You should be able to google examples/tutorials doing this using stored procedures but here’s a link to start with:
http://databases.aspfaq.com/general/how-do-i-get-the-identity/autonumber-value-for-the-row-i-inserted.html