All Forums >> [Scripting] >> ASP >> Can anyone tell me why this isn't working? Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
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):
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.
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.