Recordset problems(again)

Results 1 to 5 of 5

Thread: Recordset problems(again)

  1. #1
    Pauly Guest

    Default Recordset problems(again)

    Sorry for reposting this one but I am about 20 mins away from jumping out of the window!<BR><BR>Right - here goes.<BR><BR>This page gets a number book ISBN(Primary key) values from the request.form. These values are from a group of related check boxes.<BR><BR>I want to now execute a number of select statments to pull back specific records from the DB based on the ISBN numbers. So I feed values in to array and execute an sql statment for each book and display the results on the web page.<BR><BR>I have all of it working, the only problem is when it comes to displaying the recordset values the second time. It works first time but then I get this error. <BR><BR>It ONLY fails when you try to write info from the record set to the screen.<BR><BR>Title: Prometheus Bound error &#039 80020009&#039 <BR>Exception occurred. <BR><BR>/Projects/websites/OuNew/OrderForm.asp, line 120 <BR><BR>Heres the code as it stands now:<BR><BR>&#060;%<BR>accessdb="OU.mdb"<BR><BR>my DSN="PROVIDER=Microsoft.Jet.OLEDB.4.0;"<BR><BR>myD SN=myDSN & "DATA SOURCE=" & server.mappath(accessDB) & ";"<BR><BR>myDSN=myDSN & "USER ID=;PASSWORD=;"<BR><BR>Dim MyConn, RS<BR><BR> set MyConn=server.createobject("adodb.connection")<BR> <BR>Public Books<BR><BR>tempinput=Request.Form("Books")&#039 linked check boxes<BR><BR>Books=split(tempinput,",") &#039put ISBNs into array<BR><BR>maxcounter=ubound(Books)&#039 find out how many ISBNs<BR><BR>&#039execute sql for each ISBN and display.<BR><BR><BR>FOR i =0 TO maxcounter <BR><BR> currentBook=Books(i)<BR><BR> mySQL="SELECT * FROM Books WHERE ISBN=&#039"&currentBook &"&#039"<BR><BR> response.write(mySQL) &#039 The SQL for this book<BR><BR> set MyConn=server.createobject("adodb.connection")<BR> <BR> myDSN<BR><BR> set RS=MyConn.execute(mySQL)<BR><BR>&#039If I comment out the next two lines then it loops and works fine<BR><BR> response.write("<BR>Title: " & RS("Title")) <BR> response.write("<BR>Author: " & RS("Author") &"&#060;P&#062;") <BR> <BR> RS.close<BR> Set RS = Nothing <BR> MyConn.close<BR> Set MyConn = Nothing<BR> <BR>NEXT<BR><BR>%&#062;<BR> <BR><BR>

  2. #2
    Pauly Guest

    Default Error in last post

    Line should read:<BR><BR>mySQL="SELECT * FROM Books WHERE ISBN=&#039"& currentBook &"&#039"<BR><BR> <BR>

  3. #3
    Daemon Blair Guest

    Default RE: Recordset problems(again)

    What code is on line 120??? From what it looks like you don&#039t even have 120 lines of code? Did you post it all? I was also wondering why you never set the recordset.<BR>Set RS=server.CreateObject("adodb.recordset")<BR>Might that be your problem I wonder?<BR>Daemon Blair

  4. #4
    Pauly Guest

    Default RE: Recordset problems(again)

    The rest of the code is just HTML that I have before the DB connectivity part.<BR><BR>I use<BR><BR>If you look back at code MyConn= server.create......<BR><BR>Then set RS to MyConn.execute(MySql)<BR><BR>Also.......<BR>respon se.write("Title: " & RS("Title")) -------------- Line 120<BR>response.write("Author: " & RS("Author") &"&#060;P&#062;")

  5. #5
    KPW Guest

    Default RE: Recordset problems(again)

    Does the following KB article from MS apply at all to your situation? I noticed at the end of the article that it says something about such and such version of MDAC not experiencing this problem.<BR><BR><BR><BR>If you do a search on MSDN for your specific error message, you get a few results, but this was the only one that seemed to apply. (I didn&#039t look at every article, though.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts