Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 2.26 KB

createparameter-method-ado.md

File metadata and controls

49 lines (34 loc) · 2.26 KB
title TOCTitle ms:assetid ms:mtpsurl ms:contentKeyID ms.date mtps_version f1_keywords f1_categories ms.localizationpriority
CreateParameter method (ADO)
CreateParameter method (ADO)
cf080a0b-75d2-dcdf-2715-10af147358e9
48547799
09/18/2015
v=office.15
ado210.chm1231042
Office.Version=v15
medium

CreateParameter method (ADO)

Applies to: Access 2013, Office 2013

Creates a new Parameter object with the specified properties.

Syntax

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

Return value

Returns a Parameter object.

Parameters

Parameter Description
Name Optional. A String value that contains the name of the Parameter object.
Type Optional. A DataTypeEnum value that specifies the data type of the Parameter object.
Direction Optional. A ParameterDirectionEnum value that specifies the type of Parameter object.
Size Optional. A Long value that specifies the maximum length for the parameter value in characters or bytes.
Value Optional. A Variant that specifies the value for the Parameter object.

Remarks

Use the CreateParameter method to create a new Parameter object with a 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.

If you specify a numeric data type (adNumeric or adDecimal) in the Type argument, then you must also set the NumericScale and Precision properties.