Calling AppendParams to Retrieve Parameter Information

The AppendParams method uses the Refresh method on the Parameters collection of the Command object (oCmd) to retrieve information for the SQL Server stored procedure or for the parameterized query specified in the Command object. The following code fragment shows the use of the Refresh method, how the Visual Basic constant adParamInput identifies the input parameters, and how to create the name-value pairs the stored procedure requires:

With oCmd
   .Parameters.Refresh
   'Copy values frm FORM into PARAMETERS collection
   For Each param In .Parameters
      If param.Direction = adParamInput Then
         name = Mid(param.name, 2)
         value = oRequest.QueryString(name)
         param.value = value
      End If