Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Help needed with URLdecoding a recordset filter var


Message #1 by "Gianpiero Colagiacomo" <gp@1...> on Sat, 18 Jan 2003 04:34:59 +0100
I'm designing using Dreamweaver MX and have found a need to hand-code
(unfortunately I'm no ASP expert)...  I need to URLdecode a variable passed
in to me but can't find a way of doing it.  The recordset code shown below
is what I want to change, the ProductSubCat variable being the one I want to
decode.

How do I do it?

<%
var jg__Cat = "%";
if(String(Request.QueryString("ProductCat")) != "undefined") {
  jg__Cat = String(Request.QueryString("ProductCat"));
}
%>
<%
var jg__Subcat = "%";
if (String(Request.QueryString("ProductSubCat")) != "undefined" &&
    String(Request.QueryString("ProductSubCat")) != "") {
  jg__Subcat = String(Request.QueryString("ProductSubCat"));
}
%>
<%
var jg = Server.CreateObject("ADODB.Recordset");
jg.ActiveConnection = MM_jgcollection_STRING;
jg.Source = "SELECT *  FROM Products  WHERE ProductCat like '"+
jg__Cat.replace(/'/g, "''") + "'  AND ProductSubCat like '"+
jg__Subcat.replace(/'/g, "''") + "'  ORDER BY ProductName";
jg.CursorType = 2;
jg.CursorLocation = 2;
jg.LockType = 1;
jg.Open();
var jg_numRows = 0;
%>

Thanks in advance for any help given!

GP



  Return to Index