Solved

TAdoDataset filteroptions mistake

Posted on 2003-11-17
5
1,154 Views
Last Modified: 2011-10-03
Hi,
I am using  a TADODATASET to dislpay a list of clients into a grid.

For some reasons, I need to filter record withouts 'case sensitive' . To do this, I am using the filteroptions of my dataset.

Everytime I run the program, a messagebox appears saying : '...Edatabase error ... the filter options are not supported'.

Here is my code :

procedure TfrmFicheClients.rcmdgFiltreClick(Sender: TObject);
begin

rsclients.Filtered := true;

rsclients.FilterOptions := [foCaseInsensitive];

case rcmdgFiltre.ItemIndex of

 1 : rsclients.Filter:= 'Actif=True';
 2 : rsclients.Filter := GetSearchCriteria + ' like ''' + bufKey + '*'''  ;
else
 rsClients.Filtered := false ;
end;

lbNbrClients.Caption := '# Clients : ' + IntToStr(rsClients.RecordCount) ;

if wGClients.CanFocus then wgclients.SetFocus;

end;

So, my question is : Why this message ?? What is wrong in my code ?

PS : The Help says that if the recordset is unidirectional this cause exception.

How can see if I use bidirectional dataset ?

Thank you

PHD
0
Comment
Question by:PHD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 500 total points
ID: 9763278
it may really be that an Insensitive filter is not supported by your database

-> what database do you use?

a workaround could be to use Database-Inbuild-functions in the filterstring like

rsclients.Filter := 'Upper('+GetSearchCriteria+') like Upper('+quotedstr(bufKey + '*')+')'  ;  
//guessing upper is a valid database-function

if this is also not possible,
then is there also the possibility to use the OnFiterRecord-event

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9763287
typo
OnFiterRecord -> OnFilterRecord

btw.
filteroptions are in this case []
the star * may be replaced with %
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9777161
any results?
0
 
LVL 6

Author Comment

by:PHD
ID: 9778377
Not by your way.

It is the first time I use this site but nevertheless thank for your help.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9778480
well
>It is the first time I use this site

in this case
welcome to experts-exchange

>Not by your way
well, then you should not grade me (anyway thanks for this :-)),
there was a possibility to delete or paq this q and refunding your
points back, by asking a 0-points question at community-support

it would be nice for other members, which may have the same
problem, if you could provide your solution here?

meikl ;-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
control image tags in a string ? 12 166
Delphi: Connect to running MS Outlook 4 198
Installshield for Embarcadero EX 10.1 Berlin 4 88
firemonkey keyboard covers the controls 1 78
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question