|
Subject:
|
How to create a sequential order number?
|
|
Posted By:
|
evilandy
|
Post Date:
|
6/20/2003 11:47:39 PM
|
Just wondering how to go about creating a sequential order number for a site I'm working on. I'm using an access database with asp pages. Is it possible to update a record in the database say if the customer gets to a certain stage of the order process? ie actually only increase the order number once they have submitted there details etc. I'm guessing I could make a simple table in the database that has an autonumber or increamenting number that gets updated upon submitting a form etc. Just not sure how to implement the update of this record, ie updating the database record while at the same time submitting the asp form as normal.
Will appreciate any words of advice.
Regards,
Andy.
|
|
Reply By:
|
Imar
|
Reply Date:
|
6/21/2003 10:00:37 AM
|
Hi Andy,
The solution you propose should work well. Collect the info as they progress through the site, and when they reach a certain stage in the application (that is, ready for checkout) submit the details to the server, generate an order and return the OrderID.
There are a few ways to accomplish this, depending on your setup, the number of (concurrent) users etc. One way to do this, is to save the customer details in Session variables, and as soon as the customer wants to check out, pass the Session variables to the database to have it create the order.
Alternatively (and better scalable) you could save the customer details to a (temporary) database record and save the ShoppingCartID, or CustomerID in either a cookie or a Session variable. When you are ready to checkout, get the customer details from the DB using the CustomerID and then submit the stuff to the database (or just pass the CustomerID to the database, and create the Order entirely in the database).
If you need to find out how you can get the new OrderID, check out the following article at www.adOpenStatic.com:
http://www.adopenstatic.com/Experiments/FastestAutonumber.asp
If you have any questions, or need help with specific tasks, just post a message to this list.
Cheers,
Imar
---------------------------------------- Imar Spaanjaars Everyone is unique, except for me.
|
|
Reply By:
|
DaveGerard
|
Reply Date:
|
9/24/2003 12:06:52 AM
|
How about writing every record to the table and add a field to the table to flag whether the order is Actual or Estimate. Then filter them out as needed. After a certain time period you could dump the Estimates or perhaps use the info for tracking potential customers down the road.
|