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.

Grammar

Set objparameter=objcommand.CreateParameter
(name,type,direction,size,value)
Parameter Description
name Optional. Name of Parameter Object.
type Optional.DataTypeEnum Isang konstante, na nagtutukoy sa data type ng Parameter Object. Ang default ay adEmpty. Kung pinili mo ang data type na may nabagong haba, kailangang itakda ang parameter na Size o Size attribute. Kung itakda ang adDecimal o adNumeric data type, dapat itakda ang NumericScale at Precision attribute ng Parameter Object.
direction Optional.ParameterDirectionEnum Isang konstante, na nagtutukoy sa direksyon ng Parameter Object. Ang default ay adParamInput.
size Optional. Mga haba ng mabagong data type, kung gayunpaman ang ganitong uri ng type ay idineklara Type sa parameter. Ang default ay 0.
value Optional. Value of Parameter Object.