This topic is locked

Search and Print Does not work

11/1/2007 11:58:26 AM
ASPRunnerPro General questions
K
KeithC author

I am using ASPRunnerPro 5.1 build 327, and when I use the List Page before SQL query, the search does not seem to work.
Sub BeforeQueryList(strSQL,strWhereClause,strOrderBy)
strWhereClause = Session("CarsWhere")
End Sub
The above works on the list page as I it only lists the records that match, however when I use search on the list page it does not filter down to the search I ask for, it still shows all records matching the strWhereClause.
When I use the below I get an ODBC error which I should not.

Sub BeforeQueryPrint(strSQL,strWhereClause,strOrderBy)

strWhereClause = Session("CarsWhere")
End Sub

Sergey Kornilov admin 11/1/2007

Try this:

strWhereClause = AddWhere(strWhereClause, Session("CarsWhere"))
K
KeithC author 11/2/2007

I modified as you suggested, however I now get the below error.

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'where'.
/troopadmin/include/commonfunctions.asp, line 1062
Put it back like it was, no error however does not work properly.

Sergey Kornilov admin 11/2/2007

Try to print SQL query on the page to see what is wrong.

For this purpose set dDebug variable to TRUE in include/dbcommon.asp file.
PS. What's in the Session("CarsWhere")?