Hi
I have a simple piece of code which will not accept the wild card!
My SQL looks like
<% if Request.QueryString("num")<>"" then Var_Number = Request.QueryString("num") else Var_Number="%" end if %> <% Dim rs05 Dim rs05_numRows Set rs05 = Server.CreateObject("ADODB.Recordset") rs05.ActiveConnection = conn_05 rs05.Source = "SELECT * FROM 05 WHERE ((MinContacts <= "+ Replace(Var_Number, "'", "''")+") AND (MaxContacts >= "+ Replace(Var_Number, "'", "''")+"))" rs05.CursorType = 0 rs05.CursorLocation = 2 rs05.LockType = 1 rs05.Open() %>
Let's pretend the user doesn't specify a number and so the program uses the wildcard!
If I enter
Var_Number=%
I get the message Invalid character
If I include spech marks
Var_Number="%"
I get: Microsoft JET Database Engine error '80040e14'
((MinContacts <= %) AND (MaxContacts >= %))
I have looked online, and it says the program doesn't know how to handle % as it's probably looking for an int, but I don't know how to correct it!
Thanks for any help
Dave