This is the format for a stored proc where you want to pass parameters. This is a basic reference article the different ways you can create a stored Procedure, then pass it parameters to it.
'Name Your procedure and declare any variables using the @ symbol. 'Create this in the SQL database stored procedures section prior to running your ASP.
CREATE proc {procname} @Var1 type {@Var2 type}
As
{SQL Statement}
i.e. Select tblMe.FieldName From tblMe Where tblMeKey = @Variable1
To call Stored Procedure from ASP page you'd do
'Connection Execute Method String
set connection = server.createobject("adodb.connection") connection.open someDSN Connection.Execute "procname varvalue1, varvalue2"
'Close all objects and set to nothing connection.close set connection = nothing
********************************** 'Using Recordset Method set connection = server.createobject("adodb.connection") connection.open someDSN set rs = server.createobject("adodb.recordset") rs.Open "Exec procname varvalue1, varvalue2",connection
'Close all objects and set to nothing rs.close connection.close set rs = nothing set connection = nothing