Can anyone tell me why this isn't working?

Author Message
obiwaynekenobi

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 3/12/2008
  • Status: offline
Can anyone tell me why this isn't working? Tuesday, August 26, 2008 3:13 AM (permalink)
0
Clasisc ASP is by no means my forte, and I have inherited a huge (1000+ files), spaghetti-code ridden application.

I am trying to figure out why this snippet of code is not working right.. here's the scenario:  We have an application which queries a database for order line items, and displays them on a form.  I have verified that the product description exists in the database, and wrote a very basic ASP page to test the functionality - this was proven to work correctly.  The value is obtained at the beginning of the page, like so (code is not mine, so all bad practices are not my fault):

 on error resume next
 dim mySQL, connTemp, rsTemp, qid, stmp, rsTemp2, rsTemp3, rspLvl, rstmp
 
 pStoreFrontDemoMode     = getSettingKey("pStoreFrontDemoMode")
 
 qid = request("qid")
 mySQL = "SELECT * from getQuotesQry where idQuote = '" & qid & "'"
 call getFromDatabase(mySQL, rsTemp,"order.asp")
 
 if rsTemp.eof then
 Response.Redirect "comersus_backoffice_message.asp?message=no records found"
 end if
 


The "getFromDatabase" function just opens an ADODB connection, executes the passed-in sql, and opens the passed-in recordset.  Anyways, the issue is that the value of rsTemp("pDesc") is not modified at all, yet several hundred lines down the page (again, not my code so it's rather messy), when I check the value of it again, it is mysteriously empty (i.e. rsTemp("pDesc") = "")!  As I said, nothing else on the page is modifying it, it's only being displayed later on as the value in a textbox, but since it's empty nothing is being shown.

I'm at a loss for how to fix this, because I'm not seeing why it's happening in the first place.  Can anyone shed some light?  I can't feasibly post the entire page's code, as it's some 900 lines, but I will try to provide more information if possible.  Also, as much as it pains me I cannot remove On Error Resume Next, or the entire application breaks in dozens of different places.
 
#1
    Rischip

    • Total Posts : 519
    • Scores: 2
    • Reward points : 0
    • Joined: 3/26/2007
    • Status: offline
    RE: Can anyone tell me why this isn't working? Wednesday, August 27, 2008 1:31 AM (permalink)
    0
    You can replace On Error Resume Next in a portion of the code that you are troubleshooting with On Error Goto 0.
    Then past the code you are troubleshooting resume On Error Resume Next.
    This should get you some small insight into the code with issues. There is also not enough code here to troubleshoot anything. At least not for me.
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9