I have been trying to create a temporary recordset and store it to the Session object (not linking to a database) so I can use this for a Shopping Cart.
So if the customer closes the website then the cart is lost as its stored in the db
I was using something think:-
Code:
Dim rsCart
Set rsCart = Server.CreateObject("ADODB.Recordset")
rsCart.Fields.Append "Session ID", adText
rsCart.Fields.Append "Product ID", adText
rsCart.Fields.Append "Quantity", adText
Set Session("Cart") = rsCart
Session("Cart").AddNew()
Session("Cart")("Session ID") = Session.SessionID
Session("Cart")("Prodcut ID") = Request.Form("Product ID")
Session("Cart")("Quantity") = Request.Form("Quantity")
Session("Cart").Update()
This seems to work but when I try to display the Cart details I get an error saying the recordset is not open
I know it can be done as I've seen an example somewhere but cant find it.
Does anyone have any examples like this? I know I could do all this using a global.asa file but I want to use the Session Object instead.
Any help would be gratefull.