Print Thread
OracleDataset.Variables Property Editor
#686 07/13/00 06:06 AM
Joined: Jul 2000
Posts: 1
North Adelaide, South Australi...
C
CraigD Offline OP
Member
OP Offline
Member
C
Joined: Jul 2000
Posts: 1
North Adelaide, South Australi...
I have an end user reporting application where I need to be able to let the user create SQL against an Oracle back end. It is important to be able to provide a mechanism whereby they can create variables and set their values at run-time.

Does anyone know how you go about calling the design-time property editor for the Variables property at run-time?

Re: OracleDataset.Variables Property Editor
#687 07/14/00 04:15 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
The variable property editor was not really designed with application end-users in mind, but this is how you can use it in your application:

To invoke the variable editor for a TOracleQuery instance, add the OracleVarEdit unit to the uses clause of the unit, and use the following code:
[quote]
Code
procedure TForm1.Button1Click(Sender: TObject);
begin
  ExecuteVariablesEditor(MyQuery);
end;
[/quote]
For a TOracleDataSet instance, this is a bit more complicated:
[quote]
Code
type
  TMyOracleDataSet = class(TOracleDataSet)
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ExecuteVariablesEditor(TMyOracleDataSet(OracleDataSet).InternalQuery);
end;
[/quote]
You need to access the InternalQuery (a TOracleQuery instance) to activate the Variables Editor, which is a protected function. By deriving your own TMyOracleDataSet, you can access the protected information.


------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.034s Queries: 14 (0.009s) Memory: 2.4980 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-04-29 18:58:46 UTC
Valid HTML 5 and Valid CSS