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!

application object not incrementing

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
GB
I am using the application object to create a new order id for my shopping cart

Code:
Sub CreateNewOrder()

Application.lock
if Application("orderID") = "" then
Application("orderID") = 1
end if
       
        
intOrderID = Application("orderID")
Session("orderID") = intOrderID
							
							SQLorder = "INSERT INTO table (orderID, status) values ("&intOrderID&", 'OPEN')"
Objconn.Execute(SQLorder)
		
Application("orderID") = Application("orderID") + 1
Application.Unlock
End Sub

intOrderID = cstr(Session("orderID"))
if intOrderID = "" then
CreateNewOrder
end if

This should check to see if they have a shopping cart session, if they have then continue with that session, if not then create a new session with unique id that is generated by the application object.

My problem is that everyone on my demo is coming on the same sessionid, i.e. the application object is not incrementing.

Have I done something wrong?
 
do you have any code in Session_OnStart in global.asa??

I would not recommend storing the OrderID in the table when the user starts browsing either. I would only add a record into the order table when the user "checks out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top