Skip to main content
Participating Frequently
March 15, 2011
Question

Advanced filter recordset asp

  • March 15, 2011
  • 1 reply
  • 2824 views

Hi,

I m trying to filter an asp recordset with % wildcart but impossible to do it.

..!!

Have got a asp form with a dropdown list based on a recordset that stores value (numeric) in a variable (id).


So this variable is used on my result asp page to filter a new recordset by this numeric value.


Im using wild card in order to display all records like this SQL query:

SELECT *
FROM proprietes
WHERE ville LIKE %MMColParam%           

MMColParam defined like this :
Numeric
Request.Form("ville")

default value %

So when it generates sql query, it gives SELECT *FROM proprietes WHERE ville LIKE '%MMColParam%' and testing it, it works (testing recordset in dream) but saving it and reopens recordset the query becomes :   SELECT *FROM proprietes WHERE ville LIKE %MMColParam%   and testing recordset gives error !!

Someone can help me?

Thanks a lot.

This topic has been closed for replies.

1 reply

X-Slider
Known Participant
March 15, 2011

try this

"Select * From proprietes
WHERE ville LIKE %" + MMColParam + "%"

LSTEPHANAuthor
Participating Frequently
March 15, 2011

I become crazy it doesn't work and i don't understand !

Thanks

X-Slider
Known Participant
March 15, 2011

post your code as it is written and let me check it