p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP 3.0 (http://p2p.wrox.com/forumdisplay.php?f=27)
-   -   Chapter 15 Page 711 (http://p2p.wrox.com/showthread.php?t=8125)

JOHNW January 13th, 2004 04:21 PM

Chapter 15 Page 711
 
Greetings,

I originally tried coding this .ASP file myself but received an error message. I then downloaded the code from the WROX website, executed it and received the same error.

Here is the code from SaleDetailsForSeller.asp

Code:

strSQL = "UPDATE Item SET ItemStatus = 'Pending' " & _
           "WHERE (((Item.ItemID)=" & Request.QueryString("Item") & "));"



When I click on the link that reads: Click to sell to this bidder, I get an error message that points to the above line of code and says:

 Microsoft JET Database Engine (0x80040E14)
Extra ) in query expression '(((Item.ItemID)=))'.
/WROX/SaleDetailsForSeller.asp, line 119.

I realize that this error means that One or more form fields were empty. However I don't see where this is the case. The Item.ItemID field in my Item record does indeed have a value in it. I was wondering if anyone else has encountered this problem. I'd appreciate any help I can get.

Thanks
:)




stu9820 January 14th, 2004 10:44 AM

It is saying an extra ')' in the query. Try this:

strSQL = "UPDATE Item SET ItemStatus = 'Pending' " & _
           "WHERE ((Item.ItemID)=" & Request.QueryString("Item") & ");"


JOHNW January 14th, 2004 11:02 AM

Stu,

Thanks for the reply but I found the problem myself. It actually wasn't with SaleDetailsForSeller.asp but instead it was in Item.asp.

Code:

<a href=""SaleDetailsForSeller.asp?Item=" & _
                    Request("Item") & "&BidID= " & rsBids("BidID") & """>" & _
                    "Click to sell to this bidder</a></td>"



In the above code I originally had a space in between SaleDetailsForSeller.asp?Item and the equal sign. Because of this, "Item" was being passed to SaleDetailsForSeller.asp as an empty field. When I executed the UPDATE on that .asp file the code couldn't locate the Item.ID in the table because it was comparing it to an empty field.

All this amounted to a typo, talk about a needle in a haystack. I hope this helps anybody who might have this problem later.

Thanks again for the reply.

John




stu9820 January 14th, 2004 11:14 AM

If feels good to find the needle! :D



All times are GMT -4. The time now is 09:59 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.