-
Sorting user defined recordsets
Has there been any advances in the area of sorting when results are based on user defined recordsets? I've searched the forum and found a couple of messages based on this subject, but they were of little help. Here is my code...
<%
Set X= Server.CreateObject("ASP.DB"
X.dbUnit = "999"
X.dbMode = "Both"
X.dbDBType = "SQL65"
X.dbDAT = "server,database"
X.dbGridColSort = True
X.dbSQL = "SELECT Name,Id,cat,subcat,price,city,state FROM Table WHERE State LIKE '" & ReqState & "'"
X.ASPdb
%>
After the results are displayed, if I click on a column to sort, I get the following error:
Error: No record found
SELECT COUNT(*) as c FROM SaleProperty WHERE State LIKE ''
-
Sorting user defined recordsets (reply)
don't know how you pass the variable to construct the SQL. You have to make that persistent and save it in the session var like ->
req= request.querystring("reqstate"
if req<>"" then session("reqState"=req
X.dbSQL = "SELECT Name,Id,... FROM Table WHERE State LIKE '" & session("ReqState" & "'"
print out the SQL and make sure it is valid.
Try also - X.dbOptions="KeepUserQueryString = true" to make it sticky ! (see doc)
FK
------------
Jason at 4/23/01 8:26:05 PM
Has there been any advances in the area of sorting when results are based on user defined recordsets? I've searched the forum and found a couple of messages based on this subject, but they were of little help. Here is my code...
<%
Set X= Server.CreateObject("ASP.DB"
X.dbUnit = "999"
X.dbMode = "Both"
X.dbDBType = "SQL65"
X.dbDAT = "server,database"
X.dbGridColSort = True
X.dbSQL = "SELECT Name,Id,cat,subcat,price,city,state FROM Table WHERE State LIKE '" & ReqState & "'"
X.ASPdb
%>
After the results are displayed, if I click on a column to sort, I get the following error:
Error: No record found
SELECT COUNT(*) as c FROM SaleProperty WHERE State LIKE ''
-
Sorting user defined recordsets (reply)
neither of those suggestions worked...
I tried the session variable thing, but it still behaved the same way.
The X.dbOptions="KeepUserQueryString = true" suggestion sounded good, but it gave me a type mismatch on the X.ASPdb line.
Help!
Thanks,
Jason
------------
Frank Kwong at 4/23/01 11:31:33 PM
don't know how you pass the variable to construct the SQL. You have to make that persistent and save it in the session var like ->
req= request.querystring("reqstate"
if req<>"" then session("reqState"=req
X.dbSQL = "SELECT Name,Id,... FROM Table WHERE State LIKE '" & session("ReqState" & "'"
print out the SQL and make sure it is valid.
Try also - X.dbOptions="KeepUserQueryString = true" to make it sticky ! (see doc)
FK
------------
Jason at 4/23/01 8:26:05 PM
Has there been any advances in the area of sorting when results are based on user defined recordsets? I've searched the forum and found a couple of messages based on this subject, but they were of little help. Here is my code...
<%
Set X= Server.CreateObject("ASP.DB"
X.dbUnit = "999"
X.dbMode = "Both"
X.dbDBType = "SQL65"
X.dbDAT = "server,database"
X.dbGridColSort = True
X.dbSQL = "SELECT Name,Id,cat,subcat,price,city,state FROM Table WHERE State LIKE '" & ReqState & "'"
X.ASPdb
%>
After the results are displayed, if I click on a column to sort, I get the following error:
Error: No record found
SELECT COUNT(*) as c FROM SaleProperty WHERE State LIKE ''
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|