ADO CreateParameter Method
Definition and Usage
The CreateParameter method can create and return a Parameter object that contains specified properties, such as name, type, direction, size, and value.
Note:This method does not automatically append the Parameter object to the Command object's Parameters collection. To add the Parameter object to the Parameters collection, please use the Append property.
Syntax
Set objparameter=objcommand.CreateParameter (name, type, direction, size, value)
Parameter | Description |
---|---|
name | Optional. The name of the Parameter object. |
type | Optional.DataTypeEnum A constant that specifies the data type of the Parameter object. The default is adEmpty. If you choose a variable length data type, you need to specify the Size parameter or Size property. If you specify adDecimal or adNumeric data type, you must set the NumericScale and Precision properties of the Parameter object. |
direction | Optional.ParameterDirectionEnum A constant that defines the direction of the Parameter object. The default is adParamInput. |
size | Optional. Specifies the length of the variable data type, if such a type is declared in Type in the parameter. The default is 0. |
value | Optional. The value of the Parameter object. |