RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TParameters.CreateParameter Method

Adds a parameter to the collection.

Pascal
function CreateParameter(const Name: WideString; DataType: TDataType; Direction: TParameterDirection; Size: Integer; Value: OleVariant): TParameter;
C++
__fastcall TParameter CreateParameter(const BSTR Name, TDataType DataType, TParameterDirection Direction, int Size, OleVariant Value);

Call CreateParameter to create a single TParameter object and add it to the TParameters collection. Property values for the newly added TParameter object are supplied via CreateParameter parameters. 

Name is a WideString value containing the name of the newly created TParameter object. 

DataType is a TDataType value indicating the data type of the parameter the new TParameter object represents. 

Direction is a TParameterDirection value indicating the parameter type. A parameter represented by a TParameter may be any one of: input, output, input-output, return value. Designate a parameter as unknown if the parameter type is not know at the time the TParameter is created. 

Size indicates the maximum size of the parameter's value. 

Value is an OleVariant containing the parameter's value. A value need not be passed for Value when the TParameter is created. It can be assigned later. If no value is assigned at this time, pass a nil (Delphi) or NULL (C++) for Value.

ADOStoredProc1.CreateParameter('Parm1', ftString, pdInput, 10, nil);

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!