CreateParameter Method - ADO

Creates a new Parameter object with the specified properties.

Applies To

Command

Syntax

Set parameter = command.CreateParameter (Name, Type, Direction, Size, Value)

Return Value

Returns a Parameter object.

Parameters

Name Optional. A String representing the name of the Parameter object.

Type Optional. A Long value specifying the data type of the Parameter object. See the Type property for valid settings.

Direction Optional. A Long value specifying the type of Parameter object. See the Direction property for valid settings.

Size Optional. A Long value specifying the maximum length for the parameter value in characters or bytes.

Value, varValue Optional. A Variant specifying the value for the Parameter object.

Remarks

Use the CreateParameter method to create a new Parameter object with the specified name, type, direction, size, and value. Any values you pass in the arguments are written to the corresponding Parameter properties.

This method does not automatically append the Parameter object to the Parameters collection of a Command object. This lets you set additional properties whose values ADO will validate when you append the Parameter object to the collection.

If you specify a variable-length data type in the Type argument, you must either pass a Size argument or set the Size property of the Parameter object before appending it to the Parameters collection; otherwise, an error occurs.

Examples

Append and CreateParameter Methods Example (VB)


© 1997 Microsoft Corporation. All rights reserved.