Data.Win.ADODB.TParameter.Assign

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Assign(Source: TPersistent); override;

C++

virtual void __fastcall Assign(System::Classes::TPersistent* Source);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TParameter

Description

Copies the properties and value of one TParameter object to another.

Call Assign to make one TParameter an exact clone of another. Assign copies the values of the Attributes, DataType, Direction, Name, NumericScale, Precision, Size, and Value properties from the parameter object specified in Source to the calling parameter object.



ADOStoredProc1.Parameters[0].Assign(ADOStoredProc2.Parameters.Items[0]);



ADOStoredProc1->Parameters[0]->Assign(ADOStoredProc2->Parameters.Items[0]);



Assign may be used with various types of sources: another TParameter, a field in a table, a string list object (most often for a memo type parameter), or a TBitmap (for BLOB type fields), a TPicture (for BLOB type fields). In the example below, Assign is used to give a value for a memo type parameter from a string list object (the Lines property of a TMemo).



ADOStoredProc1.Parameters[1].Assign(Memo1.Lines);



ADOStoredProc1->Parameters[1]->Assign(Memo1->Lines);



See Also