Forums
This topic is locked
[SQL] Run time value doesn't work, testing does
Posted 12 Feb 2005 14:01:40
1
has voted
12 Feb 2005 14:01:40 Rene Bandsma posted:
---------------------------------------------------------------------------------------------------------------<b>AAAARCH!!! I'm feeling so stupid this morning! The FORM posted to my prior testpage <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>
So everything is solved now! Do not read topic! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle></b>
I have created a recordset with a SQL statement like this:
<pre id=code><font face=courier size=2 id=code>
SELECT *
FROM aanbod
WHERE category LIKE 'MMCategory' AND brand LIKE 'MMBrand' AND color LIKE 'MMColor' AND size BETWEEN MMSizeFrom and MMSizeTo
</font id=code></pre id=code>
When I test the recordset everything works fine, but when I do a run-time test as an ASP page everything is working fine except the 'BETWEEN' clause in my SQL statement.
Setting the default values for MMSizeFrom and MMSizeTo is also working fine in run time. Changing the values with textboxes and a QueryString is not working at all. I think ASP / SQL is not seeing it as an actual value (we're talking about strings?). Is there a workaround for this?
The code that reads the input for MMSizeTo and MMSizeFrom:
<pre id=code><font face=courier size=2 id=code>
<%
Dim rsWinkel__MMSizeFrom
rsWinkel__MMSizeFrom= "1"
If (Request.QueryString("van"


rsWinkel__MMSizeFrom= Request.QueryString("van"

End If
%>
<%
Dim rsWinkel__MMSizeTo
rsWinkel__MMSizeTo = "50"
If (Request.QueryString("tot"


rsWinkel__MMSizeTo = Request.QueryString("tot"

End If
%>
</font id=code></pre id=code>
The code above with setting the values between 1 and 50 is working perfect. But the recordset does not read my "van" (from in Dutch) and "tot" (To in Dutch) values.
Should I tell the database that it is about numbers and not textvalues? Like dates must be surrounded with #
Edited by - bandsma on 12 Feb 2005 14:16:25
Edited by - bandsma on 12 Feb 2005 14:16:53