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.