Filtering a TADOQuery causes an error




Hello, I tried something like this: on empty form I put an object of TADOQuery class(Query1) and objects of these classes: TDataSource (to connect the Query1), TSDBGrid (to show results), TButton (to fire an action) and wanted to use a Filter property of the Query1 object. So I put a text like this in that property - ' ( ( curr_code = ''USD'' ) or ( curr_code = ''SKK'') ) and ( some_string_field = ''V'' ) ' and set the Filtered property to TRUE. Then I tried to open the query, but Calling Query1.Open procedure raised an exception of EOleException class with this message - 'Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another'. I want to ensure you that all the fields were present in the table and data type of every field is String. However, and it's interesting, when I changed operator OR to AND, everything worked fine. So, if there's a more complicated expresion(like combination of AND and OR operators), it causes an error. As an underlying database was used MSSQL server 8 (9). Ado version is 2.8 SP1. Any idea? Please help.
.


Quantcast