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
Solved

TAdoDataset filteroptions mistake

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 57
Create Database on Android via Delphi dbExpress 3 108
Intraweb download file link ? 1 153
Press three keys together and trigger a function 3 60
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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

791 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