IIS ASP - data won't post???

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > May 2005 > data won't post???





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author data won't post???
Jim Wood

2005-05-30, 5:52 pm

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.

Thank you for any help you can provide.

Jim


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com