Board index » delphi » Filters and partial strings

Filters and partial strings

Can someone please tell me if it is possible to match partial strings
using TADOTable? (eg. NAME = 'smi*')
The Delphi help file implies that "filteroptions" are supported, but
apparently they are not.  The "readme" file that comes with Delphi 5
mentions that "ADO does not support case-sensitive filters of find
operations" but says nothing about partial strings!!
I'm converting an application from Delphi4/BDE to Delphi5/ADO and
finding it very frustrating that the partial string filters don't work.
Can anyone suggest a workaround??

Thanking you in anticipation!!!!

 

Re:Filters and partial strings


I discovered that I can do what I need to do by putting code in the
OnFilterRecord event, but I don't think that this is a completely
satisfactory alternative.  It may have to suffice if there's not a better
way.
btw, I'm not totally impressed with the Delphi help file.
Quote
dz wrote:
> Can someone please tell me if it is possible to match partial strings
> using TADOTable? (eg. NAME = 'smi*')....

Re:Filters and partial strings


Hi dz,

Quote
> Can someone please tell me if it is possible to match partial strings
> using TADOTable? (eg. NAME = 'smi*')

- to match partial strings you need to use the 'LIKE' operator (e.g. NAME
LIKE 'smi*');
- in some cases, the '*' wildcard won't work and you will have to use the
'%' wildcard (e.g. NAME LIKE 'smi%');
- see here for details:
http://msdn.microsoft.com/library/psdk/dasdk/mdap0i7m.htm

Thrse

Re:Filters and partial strings


Thanks Therese,
I feel stupid for not having tried that, given that it's SQL syntax, and
makes more sense than the previous way, but it would not have killed them to
have put a reference in the help file, given that it was a change.
Cheers
Dub
Quote
"Thrse Hanquet" wrote:
> Hi dz,

> > Can someone please tell me if it is possible to match partial strings
> > using TADOTable? (eg. NAME = 'smi*')

> - to match partial strings you need to use the 'LIKE' operator (e.g. NAME
> LIKE 'smi*');
> - in some cases, the '*' wildcard won't work and you will have to use the
> '%' wildcard (e.g. NAME LIKE 'smi%');
> - see here for details:
> http://msdn.microsoft.com/library/psdk/dasdk/mdap0i7m.htm

> Thrse

Other Threads