Forums

ASP

This topic is locked

Need help with a stored procedure

Posted 18 Feb 2003 01:10:51
1
has voted
18 Feb 2003 01:10:51 Phil Grimpo posted:
<b>Here is my code:</b>

<i>&lt;%

Dim GetSaleItemsAndInfo__SaleID
GetSaleItemsAndInfo__SaleID = "0"
if(Request.QueryString("SaleID" &lt;&gt; "" then GetSaleItemsAndInfo__SaleID = Request.QueryString("SaleID"

%&gt;
&lt;%

set GetSaleItemsAndInfo = Server.CreateObject("ADODB.Command"
GetSaleItemsAndInfo.ActiveConnection = MM_conn_MainData_STRING
GetSaleItemsAndInfo.CommandText = "dbo.GetSaleItemsAndInfo"
GetSaleItemsAndInfo.Parameters.Append GetSaleItemsAndInfo.CreateParameter("RETURN_VALUE", 3, 4)
GetSaleItemsAndInfo.Parameters.Append GetSaleItemsAndInfo.CreateParameter("@SaleID", 3, 1,1,GetSaleItemsAndInfo__SaleID)
GetSaleItemsAndInfo.CommandType = 4
GetSaleItemsAndInfo.CommandTimeout = 0
GetSaleItemsAndInfo.Prepared = true
set SaleInfo = GetSaleItemsAndInfo.Execute
SaleInfo_numRows = 0

%&gt;</i>

<b>It's standard code for DW for a stored procedure. I'm trying to pass the URL String for SaleID to the procedure.

This is the error I get:</b>

Microsoft OLE DB Provider for SQL Server error '80040e10'

Procedure 'GetSaleItemsAndInfo' expects parameter '@SaleID', which was not supplied.

/DisplaySale2.asp, line 74

<b>Now I'm passing the variable, because I can see that my string has displaysale.asp?SaleID=1

The Stored Procedure works fine when I test it in the DW Interface. Any ideas?</b>

-Grimps

Phil Grimpo
Executive Director
Inspirmedia

Edited by - pgrimpo on 18 Feb 2003 01:11:25

Replies

Replied 18 Feb 2003 01:15:21
18 Feb 2003 01:15:21 Phil Grimpo replied:
I have found out that if I comment out half the lines that DW generates, and make some mods, it will work. This just tells me there's something wrong with the code, etc.

This works (notice the lines commented out. The line in BOLD is the one I modified):

<i>
set GetSaleItemsAndInfo = Server.CreateObject("ADODB.Command"
GetSaleItemsAndInfo.ActiveConnection = MM_conn_MainData_STRING
<b>GetSaleItemsAndInfo.CommandText = "dbo.GetSaleItemsAndInfo " & GetSaleItemsAndInfo__SaleID</b>
'GetSaleItemsAndInfo.Parameters.Append GetSaleItemsAndInfo.CreateParameter("RETURN_VALUE", 3, 4)
'GetSaleItemsAndInfo.Parameters.Append GetSaleItemsAndInfo.CreateParameter("@SaleID", 3, 1,1,GetSaleItemsAndInfo__SaleID)
'GetSaleItemsAndInfo.CommandType = 4
'GetSaleItemsAndInfo.CommandTimeout = 0
'GetSaleItemsAndInfo.Prepared = true
set SaleInfo = GetSaleItemsAndInfo.Execute
SaleInfo_numRows = 0</i>

Phil Grimpo
Executive Director
Inspirmedia

Edited by - pgrimpo on 18 Feb 2003 01:16:00

Reply to this topic