setting QBE before Dataset is open

Hello,

we have a big performace problem. we are using the QBE-mode to filter the data we need.

The Problem we have is, that we have to open the Query first and than set the QBE-Filter, and execute the QBE-Query. The performace are killed, when we open the query at first.

My Question: Is there a way to open the TOracleDataset by using the QBE, when the TOracleDataSet is closed. So we do not need to send two queries to the database. WE than need only to send one Query to the database.

We hope you can help us.

thank

wilderland
 
You can set QBEMode to True before setting Active to True. Now the dataset will not execute the query when it is opened, but will only present an empty QBE record.

------------------
Marco Kalter
Allround Automations
 
Hallo,

I tried it, and it works, but I found some differences between your tip and may implementation.

At first I tried this one.
Code:
Session->Connected = true;
QryProben->QBEMode = true;
QryProben->Open();
QryProben->FieldByName("LIS_ANALYSEAUFTRAG_ID")->Value = Edit1->Text;
QryProben->ExecuteQBE();

But nothing happens, when I changed it to:

Code:
Session->Connected = true;
QryProben->Open();
QryProben->QBEMode = true;
QryProben->FieldByName("LIS_ANALYSEAUFTRAG_ID")->Value = Edit1->Text;
QryProben->ExecuteQBE();

It works well, but made to much servertraffic. So I worked on:

Code:
Session->Connected = true;
QryProben->QBEMode = true;
QryProben->Open();
if ( QryProben->State != dsInsert | | QryProben->State != dsEdit){
	QryProben->Edit();
}
QryProben->FieldByName("LIS_ANALYSEAUFTRAG_ID")->Value = Edit1->Text;
QryProben->ExecuteQBE();

After that it works well, my question now? Why is is so different when I set the QBEMode true before open the dataset and after open the dataset ?

Maybe its a bug or a undocumentet feature.

I would feel better, when each case will work in the same way.
 
The Open procedure will already fetch the records if QBEMode = False.

------------------
Marco Kalter
Allround Automations
 
Back
Top