ADO filtering... 
Author Message
 ADO filtering...

Hi again...

Can ADO filter % (percent), _ (underscore), * (asterisk)?
I found that ADO does filter the above using

  rs.Filter = "CUSTNAME LIKE '%" & txtString.Text & "%'"

but error occured when I used

  rs.Filter = "CUSTNAME LIKE '" & txtString.Text & "%'"

Why is this so? Please help...

Thanks in advance...



Sun, 12 Sep 2004 15:25:52 GMT  
 ADO filtering...
Hi,

Here is exact text from MSDN about it

"If Operator is LIKE, Value can use wildcards. Only the
asterisk (*) and percent sign (%) wild cards are allowed,
and they must be the last character in the string. Value
cannot be Null."

Val

Quote:
>-----Original Message-----
>Hi again...

>Can ADO filter % (percent), _ (underscore), * (asterisk)?
>I found that ADO does filter the above using

>  rs.Filter = "CUSTNAME LIKE '%" & txtString.Text & "%'"

>but error occured when I used

>  rs.Filter = "CUSTNAME LIKE '" & txtString.Text & "%'"

>Why is this so? Please help...

>Thanks in advance...
>.



Sun, 12 Sep 2004 22:00:25 GMT  
 ADO filtering...

Hi again...

Can ADO filter % (percent), _ (underscore), * (asterisk)?
I found that ADO does filter the above using

  rs.Filter = "CUSTNAME LIKE '%" & txtString.Text & "%'"

but error occured when I used

  rs.Filter = "CUSTNAME LIKE '" & txtString.Text & "%'"

Why is this so? Please help...

Only the asterisk and percent sign are allowed and they must be the last
character in the string.


Microsoft MVP (Visual Basic)



Sun, 12 Sep 2004 23:12:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO Filter/Find and apostrophes

2. Ado Filter Question...

3. Ado Filter ..How to use?

4. Nulls in ADO Filters

5. restricting items in listbox using ado.filter

6. listbox ado filter

7. ado filter / search records

8. ADO: Filter property - using bookmarks

9. How do you use ADO Filter properly?

10. ADO Filter problem

11. datacombo/datalist control and ado filter

12. ADO Filter on a numeric field

 

 
Powered by phpBB® Forum Software