[thelist] SQL Prob. with ASP
Asif Suria
asifsuria at yahoo.com
Fri Apr 6 04:07:23 CDT 2001
Hi Michele,
Your Update statement looks fine to me. The other
fields in the table do not matter if you only want to
update one specific field. I have a feeling that it is
the connection to the database that is causing a
problem.
Asif
> Set cnn = CreateObject("ADODB.Connection")
> cnn.open "DRIVER={Microsoft Access Driver
> (*.mdb)};DBQ=" &
>
server.mappath("/craftersshowcase/database/crafters.mdb")
>
> For Each x In Request.Form
>
> If left(x, 7) = "LineID_" then
> varQuantity = trim(request.Form(x))
> varOrderDetailID = Replace(x, "LineID_", "")
> End If
>
> Next
>
> BuildSQL = "SET Quantity = " & varQuantity & " WHERE
> OrderDetailID = " &
> varOrderDetailID & ""
>
> SqlString = "UPDATE ItemsOrdered " & BuildSQL & ""
> cnn.execute SqlString
> </code>
>
> Print out of the SQL returns this:
>
> UPDATE ItemsOrdered SET Quantity = 5 WHERE
> OrderDetailID = 78
>
> The error message I'm getting is this:
>
> Microsoft OLE DB Provider for ODBC Drivers error
> '80040e10'
> [Microsoft][ODBC Microsoft Access Driver] Too few
> parameters. Expected 1.
> /craftersshowcase/updatecart.asp, line 29
>
> Where line 29 is cnn.execute SqlString
>
> Quantity is a number
> OrderDetailID is AutoNumber
>
> I have tried this SQL instead, but I still get the
> same error.
>
> UPDATE ItemsOrdered SET Quantity = '5' WHERE
> OrderDetailID = '78'
>
> There are several other fields in the table. (Does
> that matter? - I only
> want to change this one value.)
> There is another column containing OrderNo that is
> related to other tables.
> Does that matter?
>
> TIA,
>
> Michele
>
> *going to bed*
>
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
More information about the thelist
mailing list