| Insert Record and Retrieve Unique ID ASP Script - ASP Web Pro |
|
ASP ScriptsINSERT RECORD AND RETRIEVE UNIQUE IDThere are some instances where you will need to insert a record to a database and, at the same time, you will also need to retrieve the unique id that was just created for that record. For example, a visitor to your website may sign up to become a customer. When they complete and submit their registration form, you may want to give them a unique Customer ID #. The first thing you need to do is create a database called
MyCustomers. Then create a table called tblCustomerInfo with
these fields: Next, create a form page called formpage.asp and copy the below code into your page:
Then, create a page called resultspage.asp and copy the below code into your page:
There you have it. Now you can insert a record and retrieve its unique id and display it on your page all in one fell swoop!
|
||||
|
Main Menu Other Resources
Last Updated:
|
||||
|
© 1997-2010 ASP Web Pro, Inc. | Terms of Use
|