Solved

TAdoDataset filteroptions mistake

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now