Forums
This topic is locked
Search with Multiple Parameters - Problem
Posted 31 Jul 2002 19:54:05
1
has voted
31 Jul 2002 19:54:05 Ricardo Ribeiro posted:
Hi...I followed with attention the tutorials available at this site and yet I have a problem while trying to set up a search page with multiple parameters.
This is the SQL Query:
SELECT *
FROM Products
WHERE DataFicha > varData AND Country='varPais' AND Long = varDuracao1
Naturally all the variables are defined, and with a Default Value of 1.
Now, somehow the system is not recognizing the value I'm passing as varDuracao1
The others are passing OK (one is of date type and another is a a text type) but this varDuracao1 is a numeric value and it keeps using the default value, even if I define a difernt value in the search form:
localhost/mydomain/search.asp?varData=&varPais=&varDuracao1=&varDuracao2=&varPreco1=108&varPreco2=&Submit=Pesquisar
Replies
Replied 01 Aug 2002 14:17:27
01 Aug 2002 14:17:27 Ricardo Ribeiro replied:
Now... after reading the Deamweaver Help once again I'm really confused... the guys from Macromedia insist in the usage of the % sign as a wildcard for the Default Value.
But it is a fact the such usage results in an error in Dreamweaver UltraDev. Eventually because I'm using Access and not an SQL Database.
Fine, now, if this is the case, what's the substitute for the % sign for usage with MS Access? Damn, I don't believe nobody else met this problem before, but the truth is that I can't find any valid information on this issue, anywhere. In fact some people had the problem but found no answers.
But it is a fact the such usage results in an error in Dreamweaver UltraDev. Eventually because I'm using Access and not an SQL Database.
Fine, now, if this is the case, what's the substitute for the % sign for usage with MS Access? Damn, I don't believe nobody else met this problem before, but the truth is that I can't find any valid information on this issue, anywhere. In fact some people had the problem but found no answers.
Replied 01 Aug 2002 19:33:09
01 Aug 2002 19:33:09 Owen Eastwick replied:
You may have to modify the Recorset/SELECT code in code view, you can't do everything through DW's behaviors.
Try something like:
<%
varData = Request("txtData"
varPais = Request("txtPais"
varDuraco1 = Request("txtDuraco1"
If varPais <> "" Then
varPais = " AND Country='" & varPais & "'"
End If
If varDuraco1 <> "" Then
varDuraco1 = " AND Long = '" & varDuraco1 & "'"
End If
varSQLString = "SELECT * FROM Products WHERE DataFicha > varData" & varDuraco1 & varPais
%>
Then modify the Recordset source code as follows:
RecordsetName.Source = varSQLString
Take a look at the link below too.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Try something like:
<%
varData = Request("txtData"
varPais = Request("txtPais"
varDuraco1 = Request("txtDuraco1"
If varPais <> "" Then
varPais = " AND Country='" & varPais & "'"
End If
If varDuraco1 <> "" Then
varDuraco1 = " AND Long = '" & varDuraco1 & "'"
End If
varSQLString = "SELECT * FROM Products WHERE DataFicha > varData" & varDuraco1 & varPais
%>
Then modify the Recordset source code as follows:
RecordsetName.Source = varSQLString
Take a look at the link below too.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 02 Aug 2002 11:28:24
02 Aug 2002 11:28:24 Ricardo Ribeiro replied:
Oh well... then this is something I have to quit to do. Thanks Owen. I already knew your tutorial. It's so dense and detailed that I can't read it all. And no, I'm not of the lazy kind. I spend two entire days investigating the problem.
I still can't believe there is not a wildcard to apply as default value. It's too stupid to be true.
Edited by - Torgut on 02 Aug 2002 11:37:25
Edited by - Torgut on 02 Aug 2002 12:17:01
I still can't believe there is not a wildcard to apply as default value. It's too stupid to be true.
Edited by - Torgut on 02 Aug 2002 11:37:25
Edited by - Torgut on 02 Aug 2002 12:17:01