Forum Moderators: open
Now I get ox800a000d type mismatch 'TempArray'
The code is:
Dim objRS' recordset obj
Set objRS = Server.CreateObject ("ADODB.Recordset")' create object
objRS.Open "products", strConnect, adOpenStatic, adLockReadOnly, adCmdTable' and open it
CartItems = Session("CartItems")
TempArray = Session ("Cart")
If Request.QueryString("action") = "add" then
NewCartItems = CartItems + 1
Dim TempArray2 ()
ReDim TempArray2 (NewCartItems,2)
For I = 0 to CartItems
TempArray2 (I,0) = TempArray (I,0) <<<FAILS HERE
TempArray2 (I,1) = TempArray (I,1)
TempArray2 (I,2) = TempArray (I,2)
Next
TempArray2 (NewCartItems, 0) = Request.QueryString("id")
TempArray2 (NewCartItems, 1) = Request.QueryString("quantity")
TempArray2 (NewCartItems, 2) = Request.QueryString("length")
Session ("Cart") = TempArray2
Session ("CartItems") = NewCartItems
Can anyone tell me what the problem is, I assume it has something to do with changing servers?
Have you set up state management correctly? Right click the website in IIS and select properties. Click the home directory tab. Click configuration and then the options tab. Ensure enable session state check box is checked.