Come from http://support.seagatesoftware.com/
' Simplestoredprocparam.asp
<%@ language= "VBSCRIPT"%>
<title>crystal Reports ASP example-using Stored Procedure parameters</title>
<%
'==============================================================================
' WORKING with the "DESIGNER COMPONENT and ASP to use STORED procedures
' and pass VALUES to STORED PROCEDURE PARAMETERS
'==============================================================================
'
' CONCEPT
' The Application object (oapp) is needed so we can create the
' An object.
' Once we have created the "the" "The" (orpt), we can then
' Gain access to such things the ' databaseparameters '
' he said.
'
' ALWAYS REQUIRED STEPS (contained in alwaysrequiredsteps.asp)
'-Create the Application object
'-Create the ' object
'-Open the
'
' WORK with STORED PROCEDURE PARAMETERS
'-Get the "database in the"
'-Get the database ' s Stored Procedure Parameters
'-Get the specific Store Procedure Parameter
'-Save the new value to the Stored Proc Param
'
' More ALWAYS REQUIRED STEPS
'-Retrieve the records
'-Create the page engine
'
' DISPLAY the '
'-Display the using a smart viewer
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
'==================================================================
'==================================================================
' ALWAYS REQUIRED STEPS
'
' Include the ' file alwaysrequiredsteps.asp which contains the code
' For steps:
'-Create the Application object
'-Create the '
%>
<%
' This is the ' the ' the ' the ' the ' the ' the ' the ' being used in this example.
' This variable are being used in the alwaysrequiredsteps.asp
' To use a different, change it here.
ReportName = "Simplestoredprocparam.rpt"
%>
<!--#include file= "alwaysrequiredsteps.asp"-->
<%
' If it is easier to understand, simply deletes the line above,
' and replace it with the entire contents of the ' file
' Alwaysrequiredsteps.asp
'==================================================================
'==================================================================
' LOG ONTO The examples sytem DSN against MS SQL SERVER ' PUBS ' SAMPLE DATABASE
UserID = "sa"
Password= ""
Session ("Orpt"). Moreprintengineerrormessages = False
Session ("Orpt"). enableparameterprompting = False
Set crtable = Session ("Orpt"). Database.Tables.Item (1)
Crtable. Setlogoninfo "Automation", "pubs", CStr (userid), CStr (Password)
' Create a System DSN called ' automation ' pointing to the ' pubs ' database on SQL Server.
' Add your database ' username and password to the simplestoredprocparam.asp page where indicated.
'==================================================================
'==================================================================
' WORK with STORED PROCEDURE PARAMETERS
'-Get the database ' s Stored Procedure Parameters
' Create a variable and point it to the Stored Procedure Parameter
' In the '
Set storedprocparamcollection = Session ("Orpt"). Parameterfields
'-Get the specific Store Procedure Parameter
' Create a variable and point it to the specific stored procedure
' That's we want to work on
Set Thisparam = Storedprocparamcollection.item (1)
Set ThisParam2 = Storedprocparamcollection.item (2)
Set ThisParam3 = Storedprocparamcollection.item (3)
'-Save the new value to the Stored Proc Param
' Create a variable and store ' the new value for the Stored Procedure
' In