Hi,
I figured this out and here’s my solution if it helps anyone else:
Firstly you’ll need to pass the querystring variable to your dataprocessor file, so on the my grid page add the querystring you want to pass in the URL of the data processor file (in my case the querystring is “catId”)
[code] …
mygrid.init();
mygrid.loadXML(“01_grid_sql.asp?catId=<%=request.querystring(“catId”)%>”);
var dp = new dataProcessor("01_grid_sql.asp?catId=<%=request.querystring("catId")%>");
dp.init(mygrid);[/code]
Next, in the data processor file you need to contruct the SELECT statement away from the render.sql instruction (otherwise the quotations will prevent it from working). So in my case I constructed my SELECT statement at the top of my dataprocessor file like this:
dim catnum
catnum = request.querystring("catId")
dim sqlstat
sqlstat = "SELECT tblproducts.prodId as ID , tblproducts.prodTitle, tblproducts.prodCode, tblproducts.prodPrice, tblproducts.prodStock, tblproducts.prodEnabled, tblproducts.prodFeatured, tblproducts.prodBestBuy, tblproducts.prodImpulse, tblproducts.prodMember FROM tblproducts WHERE prodCatId = " & catnum & ""
and then referenced my new SELECT statement in the grid.render_sql instruction.
[code]Dim res
Set res = CreateObject(“ADODB.Connection”)
res.ConnectionString = MM_connDB_STRING
res.Open
Dim grid
Set grid = new Connector
grid.init TypeGrid,res,“MySQL”,TypeUnspecified,TypeUnspecified
grid.render_sql sqlstat,“prodId(ID)”,“tblproducts.prodId(ID),prodTitle,prodCode,prodPrice,prodStock,prodEnabled,prodFeatured,prodBestBuy,prodImpulse,prodMember”, “”, “”[/code]
Hope this all makes sense.