Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
  #2 (permalink)  
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
  #3 (permalink)  
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:57 PM.


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