The following examples demonstrate how to create parameters for a stored procedure.The stored procedure syntax is as follows:drop proc myADOParaProc 
go
create proc myADOParaProc 
@type char(12) 
as 
select * from titles where type = @typeThe myADOParaProc takes one @type input parameter and returns data that match the specified type. The data type for the @type parameter is character, and the size is 12.The Visual Basic code is as follows:Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim prm As ADODB.Parameter
          
' Define a Command object for a stored procedure.
cmd.ActiveConnection = "DSN=pubs;uid=sa"
cmd.CommandText = "myADOParaProc"
cmd.CommandType = adCmdStoredProc
cmd.CommandTimeout = 15
       
' Set up new parameter for the stored procedure.
Set prm = Cmd.CreateParameter("Type", adChar, adParamInput, 12, "Business")
Cmd.Parameters.Append prm' Create a record set by executing the command.
Set rs = Cmd.Execute
While (Not rs.EOF)
        Debug.Print rs(0)
        rs.MoveNext
WendThe ActiveConnection, CommandText, CommandType, and CommandTimeout are specified with the same values as used in the previous example. The myADOParaPro stored procedures expects an input parameter whose data type is character and size is 12. The CreateParameter method creates a Parameter object with the corresponding characteristics: The data type is adChar for character, parameter type is adParamInput for input parameter, and data length is 12. This Parameter object is also given the name Type, and because it's an input parameter, the data value Business is specified. After a parameter is specified, the Append method appends the Parameter object to the Parameters collection. The myADOParaProc stored procedure is executed, and a Recordset object is created.