Solved

TAdoDataset filteroptions mistake

Posted on 2003-11-17
5
1,159 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

687 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