Page 1 of 1

SDAC with infopower filter dialog

Posted: Fri 18 Mar 2005 11:05
by matjazu
Hi, i have problem when using info power filter dialog with TMSQuery.
When TMSQuery is readonly=False everything works fine.
After filter is defined sql statement is created correctly.
But if TMSQuery is readonly (=true) then sql statement is not created correctly and error message is reported, for example:

Unable to execute SQL:
select * from employee where (Upper() like 'A%)

Obviously field name is missing, but that happens only when TMSQuery is read only. (where part of sql statement is created by TwwFilterDialog).
If I use TADOQuery or TQuery i don't have problem.

I use Delphi 7.1, Infopower 4000, SDAC 3.50.0.12.

Thanks for help.

Posted: Fri 18 Mar 2005 15:08
by Ikar
SDAC performs optimization on opening ReadOnly queries that can cause this result.

Are you sure that your task requires using ReadOnly = True?

Posted: Mon 21 Mar 2005 07:08
by matjazu
It's not absolutely neccessary, but it simplifies my code and is more robust, because if user isn't allowed to change data, I set query to read only.

Dos this optimization produces some other results that i should be aware of?

Posted: Mon 21 Mar 2005 09:24
by Ikar
> Dos this optimization produces some other results that i should be aware of?

Usually, if the query doesn't have key fields but result is intended to edit OLE DB adds key fields automatically. Probably, the problem can be solved if you add key fields to the query manually.