I'm running Crystal 7.0, and writing stored procedures in MS SQL 2000. This is my first attempt (or anyone else's here) to create a report that uses a parameterized stored procedure, and I can't get it to work.
I've written a simple report. One parameter. I display the parameter on the report, and the stored procedure uses it in data selection.
If I run the report using Crystal, it asks for the parameter, I enter a 'C' (without the quotes) and it displays the value on the report AND the result set from the stored procedure does contains records (i.e, the stored procedure is getting the parameter passed from Crystal.
If I run it using VB6, with the below code
crpt_Stupid_Report.ParameterFields(0) = "passedType;C;TRUE"
crpt_Stupid_Report.Action = 1
I get a "C" printed on the report, but no records are returned from the stored procedure. I can change the C in above code to an X, run it and get an X printed on the report.
If I run it using VB6, with the below code:
crpt_Stupid_Report.StoredProcParam(0) = "C"
crpt_Stupid_Report.Action = 1
I get Crystal error 20553 - Invalid parameter name.
Below is the stored procedure
CREATE PROCEDURE usp_r_AR_Stupid_Report
@passedType varchar(1)
AS
DECLARE @AsOf_Date as smalldatetime
DECLARE @Type as nvarchar(1)
SET @AsOf_Date = GetDate()
SET @Type = @passedType
SELECT * FROM uf_AR_Stupid_Records('Detail', @AsOf_Date, @Type)
GO
I'm at a loss as to why I can't do something as simple as pass a C to a stored procedure thru VB6. It should be easy. Anyone have any suggestions ??
I've written a simple report. One parameter. I display the parameter on the report, and the stored procedure uses it in data selection.
If I run the report using Crystal, it asks for the parameter, I enter a 'C' (without the quotes) and it displays the value on the report AND the result set from the stored procedure does contains records (i.e, the stored procedure is getting the parameter passed from Crystal.
If I run it using VB6, with the below code
crpt_Stupid_Report.ParameterFields(0) = "passedType;C;TRUE"
crpt_Stupid_Report.Action = 1
I get a "C" printed on the report, but no records are returned from the stored procedure. I can change the C in above code to an X, run it and get an X printed on the report.
If I run it using VB6, with the below code:
crpt_Stupid_Report.StoredProcParam(0) = "C"
crpt_Stupid_Report.Action = 1
I get Crystal error 20553 - Invalid parameter name.
Below is the stored procedure
CREATE PROCEDURE usp_r_AR_Stupid_Report
@passedType varchar(1)
AS
DECLARE @AsOf_Date as smalldatetime
DECLARE @Type as nvarchar(1)
SET @AsOf_Date = GetDate()
SET @Type = @passedType
SELECT * FROM uf_AR_Stupid_Records('Detail', @AsOf_Date, @Type)
GO
I'm at a loss as to why I can't do something as simple as pass a C to a stored procedure thru VB6. It should be easy. Anyone have any suggestions ??