Print Thread
Page 2 of 2 1 2
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 2 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.254s Queries: 15 (0.074s) Memory: 2.5208 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-04-28 23:50:42 UTC
Valid HTML 5 and Valid CSS