D
Dave
I need to filter an Access 2000 result set in ASP 30 using the ADO
recordset.filter.
I build the filter in pieces. The first clause of the filter is this...
WHERE word LIKE 'S%'
... to which other clauses are appended with AND.
This all works fine as long as I provide a condition for the first clause
(e.g., word LIKE 'S%').
However, if no condition is specified for the "Word LIKE" clause, I need to
pass a wild card and this is where I have a problem.
I tried constructing the following clauses and encountered the problems
indicated:
sFilter = "word LIKE '%' "
'Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
sFilter = "word LIKE '*' "
'Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
sFilter = "word LIKE ""%"" "
'Empty result set
sFilter = "word LIKE ""*"" "
'Empty result set rs.filter=sFilter
Yet when I try to query directly in Access...
SELECT vWords.Word
FROM vWords
WHERE word LIKE '*';
...it works fine and returns all records.
But this...
SELECT vWords.Word
FROM vWords
WHERE word LIKE '%';
,,,does not return any records
So I am confused about wild cards in Access with ADO.
Without going through complicated logic in the ASP page to test each clause
and build several filter sets, how can I pass a wild card to return all
records for a certain condition?
IOW, how do I specify a filter that does this: WHERE word LIKE '*'; in my
ASP 30 page.
recordset.filter.
I build the filter in pieces. The first clause of the filter is this...
WHERE word LIKE 'S%'
... to which other clauses are appended with AND.
This all works fine as long as I provide a condition for the first clause
(e.g., word LIKE 'S%').
However, if no condition is specified for the "Word LIKE" clause, I need to
pass a wild card and this is where I have a problem.
I tried constructing the following clauses and encountered the problems
indicated:
sFilter = "word LIKE '%' "
'Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
sFilter = "word LIKE '*' "
'Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
sFilter = "word LIKE ""%"" "
'Empty result set
sFilter = "word LIKE ""*"" "
'Empty result set rs.filter=sFilter
Yet when I try to query directly in Access...
SELECT vWords.Word
FROM vWords
WHERE word LIKE '*';
...it works fine and returns all records.
But this...
SELECT vWords.Word
FROM vWords
WHERE word LIKE '%';
,,,does not return any records
So I am confused about wild cards in Access with ADO.
Without going through complicated logic in the ASP page to test each clause
and build several filter sets, how can I pass a wild card to return all
records for a certain condition?
IOW, how do I specify a filter that does this: WHERE word LIKE '*'; in my
ASP 30 page.