...

View Full Version : Code Restructuring causes execution failure



RadarBob
12-08-2003, 05:39 PM
I have a very perplexing problem. I am restructuring an existing, working web page but the new page is failing at two out of three stored procedure calls. I simply do not know why.

My restructured code both "adds" and "updates" data on a database. Right now I'm working on the "update" stuff. In the restructured code, follow the "update" logic paths. Focus on the "lock record" stuff.

Code execution synopsis:
The "update" page is called, passing in a DB key for the record we want to edit. Three stored procedures are executed in this order:

A list of "organization types" is created - this works. The <select> dropdown is populated
The record to update is "locked" (NO, it is not really locked. An entry is made in a "locked records" table) This does not work in the restructured page.
The record data is fetched. This does not work in the restructured page. It's execution is not dependent on the "record lock" success. Trust me. This home grown record lock stuff is pretty bogus. Please don't get hung up on it.
[/list=1]

The code in lockRecord() is failing right where the ADO command.Execute is called. The VBSCript quits, and the web page is rendered on the client screen.

What is Known
[list]
The original web page works. All stored procedures work as expected. A record is created in the locked Records table and the data is put into the HTML <input> fields for editing.
The code that builds the ADO command is exactly the same in the original and restructured code
The call to this code is the same
For a given test case, the parameter list of the call is exactly the same in original and the restructured code
The ADO command parameters for both the original and restructrued code lines looks to be exactly the same in number, order, type, and value.
The fact that a forced error in the stored procedure (RAISEERROR) does not display it's message indicates that the SP is not being called - in the restructured code file.
The stored procedure works on the original web page
The stored procedure works in query analyzer given the test set of parameters


Test case parameter list for the recordlock() function

SessPersonID = 16
OrgID = 17
3rd parameter is a string literal
lockedMessage = ""
objConnection is the ASP connection object (code not included)
ReturnValue = 20000


the attachment
I had to merge 3 independent files into one. The parts are:

The original data update web page
The restructured web page
an "include" file that calls the stored procdured

Execution Environment
Client - IE 5.5 & Win98
Server - IIS v4.0
Database - MS SQL Server 2000

Roy Sinclair
12-12-2003, 10:46 PM
The fact that a forced error in the stored procedure (RAISEERROR) does not display it's message indicates that the SP is not being called - in the restructured code file.

Actually that may indicate that your browser (IE) has the option "Show Friendly Error Messages" turned on and as a result all the useful information which would tell you what's going on is removed from the error page.

Given the other points you've stated, I think you'd better look at that.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum