Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2003, 09:48 AM
Registered User
 
Join Date: Sep 2003
Location: Mansfield, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap 15 - Notifying the Bidder

on page 717 the book has me insert some new lines. Here are the important ones:
   Dim orsPendingSales
   Set orsPendingSales = Server.CreateObject("ADODB.Recordset")
   sSQL = "SELECT SaleID, WinningBid, ItemName " & _
          "FROM Sale " & _
          "INNER JOIN Item ON Sale.ItemID = Item.ItemID " & _
          "WHERE BuyerID=" & Session("PersonID") & " " & _
          "AND BuyerAcceptance=FALSE;"
   orsPendingSales.Open sSQL, oConn

When I execute the login I receive an error on the last line above:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/begasp/chap15/MenuForRegisteredUsers.asp, line 51

I am using Windows 2000 spk4 with IIS updates. Since I have used just enough of SQL syntax to understand what it is asking for I do not know if the syntax is correct for Access 2000 or MSSQL. I am using Access 2000.

Richard J. Airhart
 
Old September 4th, 2003, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I don't have the book so can't comment directly on the SQL (though it looks fine from a syntax point of view), but I can share a v useful debugging tip for sorting out SQL statements:
1. temporarily change your page to this
   Dim orsPendingSales
   Set orsPendingSales = Server.CreateObject("ADODB.Recordset")
   sSQL = "SELECT SaleID, WinningBid, ItemName " & _
          "FROM Sale " & _
          "INNER JOIN Item ON Sale.ItemID = Item.ItemID " & _
          "WHERE BuyerID=" & Session("PersonID") & " " & _
          "AND BuyerAcceptance=FALSE;"
' orsPendingSales.Open sSQL, oConn
Response.Write sSQL
Response.End

that will give you the SQL that is actually being passed to the db
2. maybe you will spot something at this stage, e.g. Session("PersonID") is empty, if not carry on below
3. open up your mdb in Access
4. create a new query and paste the results of the Response.Write into it
5. try and run it and see what happens - often you will get a more helpful error message.

hth
Phil
 
Old September 4th, 2003, 03:05 PM
Registered User
 
Join Date: Sep 2003
Location: Mansfield, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the suggestion. It proved that the variable oConn wasn't defined or not opened. When I included that portion it of course worked. Duh!





Richard J. Airhart




Similar Threads
Thread Thread Starter Forum Replies Last Post
php5 chap 15 help needed twr Beginning PHP 1 January 5th, 2008 06:20 AM
Pro PHP Chap 15 kgmcmillen Pro PHP 1 April 20th, 2006 02:38 PM
chap 15 manal_sag BOOK: Beginning ASP 3.0 2 July 10th, 2005 03:29 AM
help in chap 15 manal_sag BOOK: Beginning ASP 3.0 2 May 25th, 2005 02:59 AM
Sessions - Chap 15 mminnie BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 1 January 10th, 2005 04:25 AM





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