0
votes

In my Classic asp application I am trying to generate a web report and getting following error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='. /rpts/displayreporthtml.asp, line 13

The above error message is coming only for some cases like when record count is more than 5000 and the record count is not fixed, I mean I am geting this error for 5432, 5442, etc. number of records.

in Global.asa


Dim LTConn
set LTConn=Server.CreateObject("adodb.connection")
LTConn.CommandTimeout=5000
LTConn.ConnectionTimeout=5000
LTConn.Open "DSN=xx;uid=sa;pwd=password"

in respective page

myquery = "select   k.* from ("&myquery&")k where " & request("filterText") 
set rs=DBConn.execute (myquery)

Please guide me to resolve the issue.

Thanks,

1
post some codes. that'd be useful to understand the problempolin
Can we see the SQL command being send to the DB?Rich
Something in your SQL is wrong. Do Response.Write(myquery) to see the actual SQL (instead of executing it) and if you still can't figure what's wrong post it here and we'll try to guide you further. Please use @ to notify once you do this otherwise we won't get any notification.Shadow Wizard Is Vaccinated V3
Never EVER EVER trust user input...this code is bad request("filterText")ThatGuyInIT
Just for your info, the query is working perfectly and it gives around 24K records in backend. I have noticed page breaks after 5K records for any kind of query.Suman

1 Answers

1
votes

In your global.asa you create a connection string called LTConn In your retrieval page it seems the you call on a connection with the name DBConn. Shouldn't your query call on LTConn instead of BDConn?