DAO m_strFilter and WildCards

DAO m_strFilter and WildCards

Post by Dietmar Leibeck » Tue, 09 Sep 1997 04:00:00




> Hi all,

> I'am trying to retrieve records with wildcards using:
> m_pSet->m_strFilter = "Name = 'N*'";
> All I get is an empty record. The filter works only if I pass in the
> whole name (e.g m_pSet->m_strFilter = "Name = 'Nicholson'";) but this is
> not what I want. Since filters work like MS Access SQL why can't I use
> the " * " wildcard???? Is there anyone out there who can help me
> please????

> Thank you in advance.

> --
> Alberto Gattegno
> Nulan Technologies Ltd.
> Ha'Arad 7. Ramat Ha'Hayal.
> Tel Aviv Israel.

Alberto,

use the SQL LIKE operator!

m_pSet->m_strFilter = "Name LIKE 'N%'";

-> % matches any string of zero or more characters
-> _ wildcard for a single character

HTH,

--
Dietmar Leibecke
----------------
Address is altered to discourage junk mail.
Remove ".---" for the real address.

 
 
 

DAO m_strFilter and WildCards

Post by Alberto Gattegn » Tue, 09 Sep 1997 04:00:00


Hi all,

I'am trying to retrieve records with wildcards using:
m_pSet->m_strFilter = "Name = 'N*'";
All I get is an empty record. The filter works only if I pass in the
whole name (e.g m_pSet->m_strFilter = "Name = 'Nicholson'";) but this is
not what I want. Since filters work like MS Access SQL why can't I use
the " * " wildcard???? Is there anyone out there who can help me
please????

Thank you in advance.

--
Alberto Gattegno
Nulan Technologies Ltd.
Ha'Arad 7. Ramat Ha'Hayal.
Tel Aviv Israel.

 
 
 

1. DAO Wildcards not working in ADO queries

In parameterized queries, in DAO, a string such as "*sometext*" passed as
the 'find' text would return all instances of "sometext" whether or not it
was part of a larger word or not.

Wildcards don't seem to work with DAO. Instead you need an exact match one
or more whole words. For instance "Jan*" will not find "January" but it will
find "Jan*" if that is actually in the database. And "Jan" will not find
"January" either.

There must be some way to search for text 'scraps' in a database with ADO! I
would be most grateful for some pointers!

TIA

--
Mark E Alsop

2. Bcp on UNIX and NT

3. Access Asterisk as wildcard using DAO Jet 3

4. Problem while replicating tables

5. CdaoRecordSet::m_strFilter...problem

6. Repository Info Views <--> Tabellen

7. m_strFilter with another table

8. How to startup database automatically?

9. Query Dialog and m_strFilter

10. newbis sruggling with m_strFilter...please help

11. Crecordset is misbehaving for m_strFilter member

12. m_strFilter Problems