469,903 Members | 1,481 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Error in asp text: Command text not set for the command

Hi,
I am getting the above error in an asp page. Not sure why?
The error details is given below. I appreciate any insight
to the problem. Thanks.
The code is attached here. Line
24 is the SQL.open line.
Microsoft JET Database Engine (0x80040E0C)
Command text was not set for the command object.
/gwisbrandnewready5/indvgrant2.asp, line 24

CODE:
<%@ Language=VBScript %>
<!--#include file="adovbs.inc" -->
<%Response.Buffer = True %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>

<%
myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\_______GWISBRANDNEWREADY5\GMISDATA.mdb"

set CN=server.createobject("ADODB.Connection")
CN.Open myDSN
'cirRS stands for recordset corresponding to the resulting parameterized query
set cirRS=server.createobject("ADODB.Recordset")
cirRS.ActiveConnection = CN

Dim sFiscalStaff
sFiscalStaff = Request.QueryString("lstFiscalStaff")

SQL = "SELECT * from GMISExpenseCombo1 where FiscalStaffIntID = " &
sFiscalStaff
'Response.Write SQL
cirRS.Open

%>
<BODY>
<div ALIGN="CENTER">
<big><big><font COLOR="navy">On-Line Grant Reporting System</font></big></big>

<H4>
<font COLOR="red">Listing Of Subgrants</font>
</H4>
</div>
<div align="center">
<%
Response.Write "<table border='1' width='80%' height='1' cellspacing='1' >"
Response.Write "<th>Key</th><th>SubgrantID</th><th>Title"
%>
<%
do until cirRS.eof
Key = cirRS("IntID")
Subgrant = cirRS("ComboID")
Title = cirRS("Title")
%>

<tr>
<td align="center">
<div style="cursor:hand"><p align="left"
OnClick="location.href='mainreportagain1.asp?Grant ID=<%Response.Write Key%>'">

<u><font color="#0000FF">
<%Response.Write Key%></font></u></div></td>
<% 'this writes out the key%>
</td>

<td align='center'>
<font color="#000000">
<%Response.Write Subgrant%>

<td align='left'>
<font color="#000000">
<%Response.Write Title%>
</td>
</tr>

<%
cirRS.MoveNext
loop
%>
<input type="button" value="Log Out" name="btn_LogOut" >
<input type="button" value="IndvGrant" name="btn_IndSubgrant">

</BODY>
</HTML>
Jul 22 '05 #1
2 5637
I got the solution to the problem.
I forgot to write cirRS.Open SQL
Instead I wrote cirRS.Open.
Thanks. Regards.
"Jack" wrote:
Hi,
I am getting the above error in an asp page. Not sure why?
The error details is given below. I appreciate any insight
to the problem. Thanks.
The code is attached here. Line
24 is the SQL.open line.
Microsoft JET Database Engine (0x80040E0C)
Command text was not set for the command object.
/gwisbrandnewready5/indvgrant2.asp, line 24

CODE:
<%@ Language=VBScript %>
<!--#include file="adovbs.inc" -->
<%Response.Buffer = True %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>

<%
myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\_______GWISBRANDNEWREADY5\GMISDATA.mdb"

set CN=server.createobject("ADODB.Connection")
CN.Open myDSN
'cirRS stands for recordset corresponding to the resulting parameterized query
set cirRS=server.createobject("ADODB.Recordset")
cirRS.ActiveConnection = CN

Dim sFiscalStaff
sFiscalStaff = Request.QueryString("lstFiscalStaff")

SQL = "SELECT * from GMISExpenseCombo1 where FiscalStaffIntID = " &
sFiscalStaff
'Response.Write SQL
cirRS.Open

%>
<BODY>
<div ALIGN="CENTER">
<big><big><font COLOR="navy">On-Line Grant Reporting System</font></big></big>

<H4>
<font COLOR="red">Listing Of Subgrants</font>
</H4>
</div>
<div align="center">
<%
Response.Write "<table border='1' width='80%' height='1' cellspacing='1' >"
Response.Write "<th>Key</th><th>SubgrantID</th><th>Title"
%>
<%
do until cirRS.eof
Key = cirRS("IntID")
Subgrant = cirRS("ComboID")
Title = cirRS("Title")
%>

<tr>
<td align="center">
<div style="cursor:hand"><p align="left"
OnClick="location.href='mainreportagain1.asp?Grant ID=<%Response.Write Key%>'">

<u><font color="#0000FF">
<%Response.Write Key%></font></u></div></td>
<% 'this writes out the key%>
</td>

<td align='center'>
<font color="#000000">
<%Response.Write Subgrant%>

<td align='left'>
<font color="#000000">
<%Response.Write Title%>
</td>
</tr>

<%
cirRS.MoveNext
loop
%>
<input type="button" value="Log Out" name="btn_LogOut" >
<input type="button" value="IndvGrant" name="btn_IndSubgrant">

</BODY>
</HTML>

Jul 22 '05 #2
Jack,

Thanks for showing us what the answer was that you figured out!

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Patrick.O.Ige | last post: by
3 posts views Thread by Jim in Arizona | last post: by
3 posts views Thread by Adriano | last post: by
3 posts views Thread by Doug Durrett | last post: by
21 posts views Thread by one2001boy | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.