Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ado filter 1

Status
Not open for further replies.

ttuser4

MIS
Jun 19, 2008
147
CA
wild card (*) has to be the last character. but what to do if you need filter like this:

If chST.Value = 1 And chTG.Value = 0 Then
rs3.Filter = "Type LIKE '*ST'"
End If

any idea how to deal with such situation?
 
Using the ADO local client cursor and the rs.Filter property, as in the OP, you can use both, the % and * wildcards, because the cursor is not dependent on the underlying dbms provider.
So, whether the data comes from SQL Server, or MS Access, or dynamically created, the % and * wildcards work with the .Filter property and LIKE clause on a client cursor.

Using the .Filter property LIKE clause, the Wildcard always need to be the last character, or the first and last character, but never just the first character.

So, these wildcard usages work:

"Type LIKE '*ST*'"
"Type LIKE 'ST*'"
"Type LIKE '%ST%'"
"Type LIKE 'ST%'"

But these do not work:

"Type LIKE '*ST'"
"Type LIKE '%ST'"





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top