Stored Proc returning decimal value to ASP using ADO
Posted in 1998
I have a project which uses IDS 7.3 on Digital UNIX 4.0D,
The web server is IIS4 with MDAC 2.0 SDK
I am using the intersolv 3.01 driver for informix
The problem is really wierd in that it only occurs when the decimal value is
10.
I get the following error where my page is meant to display the decimal
value.
Response object error 'ASP 0101 : 80070057'
Unexpected error
/TEST/pa.asp, line 55
The function returned |.
Basically the ASP runs a stored procedure on informix using ADO.
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout")
DataConn.CommandTimeout = Session("DataConn_CommandTimeout")
DataConn.Open Session("DataConn_ConnectionString"),
Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")
' create the command object to run the Stored Procedure
Set DataCmd = Server.CreateObject("ADODB.Command")
' create the parameters
Set DataParam = DataCmd.CreateParameter("l_session_id", adInteger,
adParamInput, 4, 31321321)
DataCmd.Parameters.Append DataParam
Set DataParam = DataCmd.CreateParameter("l_branch", adChar,
adParamInput, 3, "101")
DataCmd.Parameters.Append DataParam
Set DataParam = DataCmd.CreateParameter("l_account", adChar,
adParamInput, 6, "058841")
DataCmd.Parameters.Append DataParam
Set DataParam = DataCmd.CreateParameter("l_part", adChar, adParamInput,
15, "01313070")
DataCmd.Parameters.Append DataParam
DataCmd.CommandText = "pa"
DataCmd.CommandType = adCmdStoredProc
Set DataCmd.ActiveConnection = DataConn
' create the recordset
Set rs_read_many = Server.CreateObject("ADODB.Recordset")
rs_read_many.Open DataCmd, , adOpenForwardOnly, adLockReadOnly
....
....
....
<% = rs_read_many(i) %> <!--- this is where the problem occurs when we
try to display element with 10 --->
...
...
...
The problem occurs when I try to display the element of the recordset that
has a decimal value of 10.
I have tried re-arranging the order of the return values, the datatype the
SPL returns in this instance is decimal(4,2).
The problem goes away if the return value is not 10 !
The procedure works perfectly under dbaccess.
This is the section that returns from the SPL;
return l_part_no, l_description, l_list_price, l_stock_uom,
l_price_uom, l_qty_avail, l_cust_price, l_disc_pct, l_disc_amt,
l_tax_pct, l_tax_amt, l_total_inc, l_total_ex with resume;
I later found that in any of the variables that are either money or decimal
which return 10 cause the problem.
This is really wierd.