Solved

TAdoDataset filteroptions mistake

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Splash screen too shortlived 11 113
Save pdf file to other location 3 72
code issue 8 85
Process Javascript errors with Delphi TWebBrowser 1 97
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 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

18 Experts available now in Live!

Get 1:1 Help Now