VirtualDAC

TCustomDADataSet.MacroByName Method

Finds a Macro with the name passed in Name.

Class

TCustomDADataSet

Syntax

function MacroByName(const Value: string): TMacro;

Parameters
Value
Holds the name of the Macro to search for.
Return Value
the Macro, if a match was found.

Remarks

Call the MacroByName method to find a Macro with the name passed in Name. If a match was found, MacroByName returns the Macro. Otherwise, an exception is raised. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate a parameter by name without raising an exception if the parameter is not found, use the FindMacro method.

To assign the value of macro use the TMacro.Value property.

Example

VirtualQuery.SQL:= 'SELECT * FROM Scott.Dept ORDER BY &Order';
VirtualQuery.MacroByName('Order').Value:= 'DeptNo';
VirtualQuery.Open; 

See Also

© 1997-2017 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback