Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Command text was not set for the command object

Status
Not open for further replies.

PleaseGiveHelp

Programmer
Oct 29, 2002
131
0
0
US
I am receiving this error on my ASP pages:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E0C)
Command text was not set for the command object.
/admin/exceptions/voyg/report.asp, line 61

I only added one small thing so I don't understand why its freaking out on me. Any ideas?
 
This is the code in the delete.asp page:

<%@ Language=VBScript %>
<% response.buffer="true" %>
<!--#include file="../lib/voyager.inc"-->
<%
account = Replace(Trim(Request.QueryString("account_id")), "'", "''")
cus = Replace(Trim(Request.QueryString("cusip")), "'", "''")
trdate = Replace(Trim(Request.QueryString("trade_date")), "'", "''")
error = Replace(Trim(Request.QueryString("error_number")), "'", "''")
reportNo = Request.QueryString("strNo").Item
strSQL = "delete from ssga_unmatched_trades"
strSQL = strSQL + " where account_id like '" + account + "%'" + " and cusip like '%" + cus + "%'"
strSQL = strSQL + " and trade_date like '" + trdate + "%'" + " and error_number = " + error + ""

'set Recordset1 = Server.CreateObject("ADODB.Recordset")
'Recordset1.Open strSQL,db,0,1
%>
strSQL = <% =reportNo %>

<% Response.Redirect ("report.asp?strNo='" & Response.Write("reportNo") & "'") %>

<% 'Recordset1.close
'set Recordset1 = nothhing %>

and the code (area that is erroring out) in report.asp is:

<%@ Language=VBScript %>
<% response.buffer="true" %>
<!--#include file="../lib/voyager.inc"-->
<%
' Set Page Size
iPageSize = 300
strSQL = ""

' Retrieve page to show or default to 1
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If

' Create recordset and set the page size
Set objPagingRS = Server.CreateObject("ADODB.Recordset")
objPagingRS.PageSize = iPageSize

' You can change other settings as with any RS
objPagingRS.CacheSize = iPageSize

If Request.QueryString("order") = "" Then
strOrderBy = " account_id, order_ID"
Else
strOrderBy = Replace(Request.QueryString("order"),"'","''")
End If

If Request.QueryString("strNo") = "1" Then
reportNo = 1
strSQL = strAllExecutions + " order by " + strOrderBy
strHeader="ALL Trade Exceptions from Voyagersql"
end if
if Request.QueryString("strNo") = "2" THEN
reportNo = 2
strSQL = strEQFIExecutions + " order by " + strOrderBy
strHeader="Equity/Fixed Income Trade Exceptions from Voyagersql"
end if
if Request.QueryString("strNo") = "3" THEN
reportNo = 3
strSQL = strCTFExecutions + " order by " + strOrderBy
strHeader = "CTF Trade Exceptions from Voyagersql"
end if
if Request.QueryString("strNo") = "4" THEN
reportNo = 4
strSQL = strOMFExecutions + " order by " + strOrderBy
strHeader = "Outside Market Value Trade Exceptions from Voyagersql"
end if
if Request.QueryString("strNo") = "5" THEN
reportNo = 5
strSQL = strSSgATrades + " order by " + strOrderBy
strHeader = "SSgA/BFDS Trade Exceptions from Voyagersql"
end if
if Request.QueryString("strNo") = "6" THEN
reportNo = 6
strSQL = strPTrustTrades + " order by " + strOrderBy
strHeader = "PTrust Trade Exceptions from Voyagersql"
end if

' Open RS
objPagingRS.Open strSQL, db, adOpenStatic,adLockReadOnly
 
Have you tried:
Code:
response.write(strSql):response.end 'right here - to see your SQL statement?
objPagingRS.Open strSQL, db, adOpenStatic,adLockReadOnly
 
I tried this and the sql is fine. Basically everything works until I change one thing. I am displaying the contents of the query along with a delete button. Once the button is pressed, the row is deleted. Behind the button is: Response.write "<a href='delete.asp?account_id=" & objPagingRS.Fields.Item("account_id").Value &_
"&amp;strNo=" & Request.QueryString("strNo").Item & " &amp;cusip=" & objPagingRS.Fields.Item("cusip").Value & "&amp;trade_date=" & objPagingRS.Fields.Item("trade_date").Value & _
"&amp;error_number=" & objPagingRS.Fields.Item("error_number").Value &_
"'><img src='../Images/delete.gif'></a>" & "</td><td bgcolor=#EFEFEF><font size=1>"

It doesn't seem to like the "Request.QueryString("strNo").Item". I'm assuming at least because when I take that out it works fine.

On the delete. asp page, I am trying to send back the strNo data:

<% Response.Redirect ("report.asp?strNo='" & Response.Write("reportNo") & "'") %>
 
I think its the delete.asp page thats giving the problem because it can't read the string I'm feeding it:

<% Response.Redirect ("report.asp?strNo='" & Response.Write("strNo") & "'") %>
 
Never mind - I figured it out. Here is the correct syntax:
<% Response.Redirect ("report.asp?strNo=" & strNo & "") %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top