data won't post???

Discussion in 'ASP General' started by Jim Wood, May 30, 2005.

  1. Jim Wood

    Jim Wood Guest

    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
     
    Jim Wood, May 30, 2005
    #1
    1. Advertising

  2. Jim Wood

    Jim Wood Guest

    Re: follow up...

    it appears that heart of the problem is that the ItemID is not being added
    to the basket.

    Jim
     
    Jim Wood, May 31, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vishal
    Replies:
    1
    Views:
    696
    Steve C. Orr [MVP, MCSD]
    Dec 21, 2004
  2. Chad
    Replies:
    4
    Views:
    8,380
  3. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    796
    Masudur
    May 25, 2007
  4. Hal Vaughan
    Replies:
    4
    Views:
    788
    Hal Vaughan
    Jan 14, 2008
  5. Jim Wood

    data won't post???

    Jim Wood, May 30, 2005, in forum: ASP General
    Replies:
    2
    Views:
    133
    Jim Wood
    May 31, 2005
Loading...

Share This Page