J
Jim Wood
I cannot figure out what is wrong here. I have a search results page that
sends the objRst("ID") to the item_media page:
<td>
<a href="../order/item_media.asp?Id=<%=objRst("Id")%>"> Add To
Cart</a>
</td>
I will be adding options to select additional characeristics later, but for
now nothing else happens, the ID should just pass from the item_media.asp
page to the order_add.asp with this statement:
<form method="POST" action="order_add.asp" name="Order">
order_add.asp adds the ID to the shopping cart dictionary:
Sub AddItemToCart(ItemId, ItemQuantity)
If Session("Cart").Exists(ItemId) Then
Session("Cart")(ItemId) = Session("Cart")(ItemId) + ItemQuantity
Else
Session("Cart").Add ItemId, ItemQuantity
End If
End Sub
' Using a dictionary to be able to name the keys to correspond to the
' item numbers and then use their value to hold the quantity.
If Not IsObject(Session("Cart")) Then
Set Session("Cart") = Server.CreateObject("Scripting.Dictionary")
End If
ItemID = Request("ID")
ItemQuantity = 1
AddItemToCart ItemId, ItemQuantity
Response.Redirect "order.asp"
and from there it is redirected to order.asp to display all the items in the
basket:
<%
If IsObject(Session("Cart")) Then
For Each Key in Session("Cart")
objRst.Open "SELECT * FROM tape_list WHERE Id = " & Key, objConn
%>
I keep getting an "Syntax error (missing operator) in query expression 'Id
='.
/Sermons/order/order.asp, line 48" which is the objRst Open "SELECT..
statement above. I *think* the ID is not getting added to the shopping cart,
but I can't tell for sure. If I remove the item_media.asp form from the
flow, it works perfectly. Can anyone see what I'm missing? I don't
understand why the word "key" is used, is it significant or just convienent?
I don't see it defined or dim'd elsewhere.
you can see this page at www.bookfixer.com/prototype/
Thank you for any help you can provide.
Jim
sends the objRst("ID") to the item_media page:
<td>
<a href="../order/item_media.asp?Id=<%=objRst("Id")%>"> Add To
Cart</a>
</td>
I will be adding options to select additional characeristics later, but for
now nothing else happens, the ID should just pass from the item_media.asp
page to the order_add.asp with this statement:
<form method="POST" action="order_add.asp" name="Order">
order_add.asp adds the ID to the shopping cart dictionary:
Sub AddItemToCart(ItemId, ItemQuantity)
If Session("Cart").Exists(ItemId) Then
Session("Cart")(ItemId) = Session("Cart")(ItemId) + ItemQuantity
Else
Session("Cart").Add ItemId, ItemQuantity
End If
End Sub
' Using a dictionary to be able to name the keys to correspond to the
' item numbers and then use their value to hold the quantity.
If Not IsObject(Session("Cart")) Then
Set Session("Cart") = Server.CreateObject("Scripting.Dictionary")
End If
ItemID = Request("ID")
ItemQuantity = 1
AddItemToCart ItemId, ItemQuantity
Response.Redirect "order.asp"
and from there it is redirected to order.asp to display all the items in the
basket:
<%
If IsObject(Session("Cart")) Then
For Each Key in Session("Cart")
objRst.Open "SELECT * FROM tape_list WHERE Id = " & Key, objConn
%>
I keep getting an "Syntax error (missing operator) in query expression 'Id
='.
/Sermons/order/order.asp, line 48" which is the objRst Open "SELECT..
statement above. I *think* the ID is not getting added to the shopping cart,
but I can't tell for sure. If I remove the item_media.asp form from the
flow, it works perfectly. Can anyone see what I'm missing? I don't
understand why the word "key" is used, is it significant or just convienent?
I don't see it defined or dim'd elsewhere.
you can see this page at www.bookfixer.com/prototype/
Thank you for any help you can provide.
Jim