[thelist] Update Quantity in Shopping Cart

Michele Foster michele at wordpro.on.ca
Fri Apr 6 11:17:53 CDT 2001

----- Original Message -----
From: "Scott Dexter" <sgd at ti3.com>

| Are you talking about building the page or processing it?

Processing the page .. BUT, I may have a problem in the way I have built it
too.  At this point, I'm trying to get the Update records solved first.
This is where I'm at right now.  I'll deal with the deletes after (but of
course first as you suggest).

| Building:
| need more info =)
| Processing:
| I loop the deletes first, then scroll through the rest of it, updating all
| the records (even the ones that weren't changed). The update command won't
| throw an error on the records that were just deleted...

Ok, makes sense.  I think my problem is my looping through the records
gathered from the querystring.

What I've done ..

For the Quantity field,
name="LineID_<get from database>"
value="<get from db>"

Then, what I'm trying to do is,

For Each x In Request.Form
    If left(x, 7) = "LineID_" then
       varQuantity = trim(request.Form(x))
       varOrderDetailID = Replace(x, "LineID_", "")
       Set cnn = CreateObject("ADODB.Connection")
      cnn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
      BuildSQL = "SET Quantity = " & varQuantity & " WHERE OrderDetailID = "
& varOrderDetailID & ""
      SqlString = "UPDATE ItemsOrdered " & BuildSQL & ""
      cnn.execute SqlString
   End If

But, it's broke. :(

Here's the error message,

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/craftersshowcase/updatecart.asp, line 13

Where line 13 is the cnn.execute SqlString

*Lost and confused*  I don't know where my error is.  :(

Any ideas?



More information about the thelist mailing list