Print Thread
Page 1 of 2 1 2
New problems with QBEDefinition->Allow Operators
#6057 02/18/04 04:09 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
Hello,
I have new problems with QBEDefinition->Allow Operators of the TOracleDataSet.
If my TOracleDataSet has some fkLookup fields and
QBEDefinition->Allow Operators = true then
I click the nbEnterQBE and choice some Value from my Lookup field, after I click nbExecuteQBE next I click the nbEnterQBE once more.
As result I see the empty value of my Lookup field in the QBEMode.
For example, I have corrected the DeptEmp example from your Demos.
1. Remove DeptGroupBox.
2. I clear Master, MasterFields, DetailFields, Variables properties for EmpDataSet.
3.I change SQL-text for EmpDataSet into the next value

Re: New problems with QBEDefinition->Allow Operators
#6058 02/18/04 08:34 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
If AllowOperators = True, you can no longer see lookup values in QBE mode. The QBE values no longer need to match the data type of the field, so a lookup cannot be performed.

For example, you could enter '10 or 20' in the deptno field. This cannot be looked up in the deptarmtent dataset. Lookup values will only be fetched after executing the query.


Marco Kalter
Allround Automations
Re: New problems with QBEDefinition->Allow Operators
#6059 02/18/04 09:13 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
[quote]Originally posted by Marco Kalter:
If AllowOperators = True, you can no longer see lookup values in QBE mode. [/quote]However I see lookup values in QBE mode, but only in a first time. I see lookup values in QBE mode and I can choose any value. Problem is another - I do not see chosen (only chosen!) values of lookup-fields at the time of next entering into QBEMode.
Thanks,
Anatol

Re: New problems with QBEDefinition->Allow Operators
#6060 02/19/04 09:00 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
You can still use the lookup control in QBE mode to set the value of the QBE field. This lookup control will be empty if you subsequently enter QBE mode again.

Is that what you mean?


Marco Kalter
Allround Automations
Re: New problems with QBEDefinition->Allow Operators
#6061 02/19/04 09:18 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
[quote]Originally posted by Marco Kalter:
You can still use the lookup control in QBE mode to set the value of the QBE field. This lookup control will be empty if you subsequently enter QBE mode again.

Is that what you mean?
[/quote]Yes, you are right.
Thanks,
Anatol

Re: New problems with QBEDefinition->Allow Operators
#6062 02/27/04 12:02 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
Will you fix it as the error?

Re: New problems with QBEDefinition->Allow Operators
#6063 02/27/04 08:18 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
It doesn't seem like an error to me. In QBE mode with Allow Operators = True, the lookup control cannot be populated, because there is no guarantee that the QBE value matches the datatype of the underlying field.


Marco Kalter
Allround Automations
Re: New problems with QBEDefinition->Allow Operators
#6064 03/01/04 12:40 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
[quote]Originally posted by Marco Kalter:
In QBE mode with Allow Operators = True, the lookup control cannot be populated, because there is no guarantee that the QBE value matches the datatype of the underlying field. [/quote]I do not understand it. With any (True or False) value of the Allow Operators the behavior of lookup

Re: New problems with QBEDefinition->Allow Operators
#6065 03/01/04 10:52 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
The lookup functionality is essentially one-way in QBE mode if Allow Operators = True. You can select a key value from the lookup control, but a key value that is entered cannot be selected in the lookup control. This is because the key value can now contain QBE expressions such as wildcards, comparisons, and so on. The QBE value might be a correct key value, but there is no guarantee.


Marco Kalter
Allround Automations
Re: New problems with QBEDefinition->Allow Operators
#6066 03/04/04 04:55 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
[quote]Originally posted by Marco Kalter:
The QBE value [b]might be a correct key value, but there is no guarantee. [/b][/quote]You are right but it does not depend from value of the Allow Operators. If Allow Operators= False I can also enter non-correct key value but problems with displaying QBE value of lookup-controls does not exists.

Try once more. Allow Operators=True, QBEMode=True.
1.I chose some value in the lookup control.
2.I enter some expression into control with the key value.
3.
a)I go out from the control with the key value then automatically the control with the key value is restored the previous value which corresponds the key value from the lookup control.
b)I remain on the control with the key value and click the nbExecuteQBE button on the TOracleNavigator. In that case the QBEvalue in the lookup control is cleared and only after QBE- query is executed.
Therefore now if QBE value of the lookup control is not empty then there is guaranteeing the correctness of the key and lookup values. And I do not see reasons to hide QBE value of lookup fields.

In any case your current solution (QBE values of lookup controls are non-empty but non-visual) is worst variant.

Re: New problems with QBEDefinition->Allow Operators
#6067 03/04/04 11:05 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
You have to understand that in QBE mode, with Allow Operators = True, the fields do not have values. This is impossible, because the text you enter in the QBE controls do not necessarily match the data type of the underlying field. That is why it is a one-way situation, and there is not much we can do about this.


Marco Kalter
Allround Automations
Re: New problems with QBEDefinition->Allow Operators
#6068 03/15/04 09:01 PM
Joined: Feb 2004
Posts: 10
Ukraine
A
Anatol Offline OP
Member
OP Offline
Member
A
Joined: Feb 2004
Posts: 10
Ukraine
[quote]Originally posted by Marco Kalter:
You have to understand that in QBE mode, with Allow Operators = True, the fields do not have values. [/quote]Of course, I said about values of the QBEDefinition (QBEDefinition->Fields[i]->Value).
However if Allow Operators = True then for all lookup-fields values of the QBEDefinition are equal Null. In my opinion it is bad news :-) and I hope you will find a better solution in the future.
To correct this problem I have used now the BeforeQBE event. I have found and cleared values of KeyFields for all lookup fields. For example (simplified version):
for(int i=0;i<Sender->FieldCount;i++)
{
TField *f=Sender->Fields->Fields[i];
if(f->FieldKind == fkLookup)
{
TQBEField *QBEField=Sender->
QBEDefinition->FieldByName(Sender->
Fields->Fields[i]->FieldName);
AnsiString s=QBEField->FieldName;
if(QBEField->Queryable)
{
if(f->LookupKeyFields != "")
{
TList *lKeyFs= new TList();
Sender->GetFieldList(lKeyFs,
f->LookupKeyFields);
for(int j=0;j<lKeyFs->Count;j++)
{
TField *fl=(TField *)lKeyFs->Items[j];
Sender->QBEDefinition->FieldByName
(fl->FieldName)->Value="";
}
delete lKeyFs;
}
}
}
}
It is clumsy solution but, IMHO, it is better of current solution :-).

Page 1 of 2 1 2

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.086s Queries: 13 (0.048s) Memory: 2.5695 MB (Peak: 3.0395 MB) Data Comp: Off Server Time: 2024-04-28 22:06:19 UTC
Valid HTML 5 and Valid CSS