Article ID: 178038
Article Last Modified on 3/14/2005
collection.Delete IndexThe collection placeholder represents the collection from which you want to delete an object. The Index argument is a string representing the name of the object you want to delete.
create procedure sp_varchar @cust varchar AS SELECT * FROM employee
create procedure sp_int @cust int AS SELECT * FROM employee
==============sample ASP code===============
<%
Set pubs = Server.CreateObject("ADODB.Connection")
pubs.ConnectionTimeout = Session("pubs_ConnectionTimeout")
pubs.CommandTimeout = Session("pubs_CommandTimeout")
pubs.Open Session("pubs_ConnectionString"),
Session("pubs_RuntimeUserName"), Session("pubs_RuntimePassword")
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set DataCommand1 = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "dbo.""sp_varchar"""
cmdTemp.CommandType = 4
Set cmdTemp.ActiveConnection = pubs
'Syntax:
'Set parameter = command.CreateParameter(Name, Type, Direction, Size,
'Value)
'200 is the value for Varchar datatype.
'1 is the value for an input parameter.
Set tmpParam = cmdTemp.CreateParameter("@cust", 200, 1, 6,"mytest")
cmdTemp.Parameters.Append tmpParam
DataCommand1.Open cmdTemp, , 0, 1
%>
<%
'========================
'The commented out line below is required to correctly clear the
'varchar parameter before creating the int parameter. Uncomment the
'line below and the code will work correctly.
'========================
'cmdTemp.Parameters.Delete "@cust"
Set DataCommand2 = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "dbo.""sp_int"""
cmdTemp.CommandType = 4
Set cmdTemp.ActiveConnection = pubs
'Integer data type with a value of 3
Set tmpParam = cmdTemp.CreateParameter("@cust", 3, 1, 4,3)
cmdTemp.Parameters.Append tmpParam
DataCommand2.Open cmdTemp, , 0, 1
%>
========end sample ASP code=================
Keywords: kbprb KB178038