财政学第四版pdf:求助帮忙解决Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e0c'

来源:百度文库 编辑:高校问答 时间:2024/05/08 03:32:43
VB调试出现了这个错误Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e0c'
没有为命令对象设置命令。

/rencai/recieve.asp,行198 (198行是set rs4 = Cmd.Execute)

具体源码如下,跪求高手指点.
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>
<% response.expires = 0%>
<% Response.Buffer = true%>
<!--#include file="../adovbs.inc"-->
<%
dim dsn
dim conn
dim rs
dim rs2
dim rs3
dim rs4
dim sql
dim cmd
dim flag
dim flag1
dim rownum
dim str
dim cflag
dim colortype
dim i
dim qrydetail
dim numrows
dim ctype

dsn = Application("zjwmrc_5100")
set conn=server.CreateObject("ADODB.Connection")
Set Cmd = Server.CreateObject("ADODB.Command")
conn.Open dsn
Set Cmd.ActiveConnection =Conn
set rs = server.CreateObject("ADODB.Recordset")
set rs2 = server.CreateObject("ADODB.Recordset")
set rs3 = server.CreateObject("ADODB.Recordset")
set rs4 = server.CreateObject("ADODB.Recordset")

rs.LockType = adLockReadOnly

flag1 = ""

sql = "select id,stat,password from wm_rc_login where usrname = '" + session("wm_usrname") + "'"

rs.open sql,conn,1,1
if rs.EOF then
flag1 = "true1"
session("wm_usrname") = ""
session("wm_password") =""
else if rs("password") <> session("wm_password") then
flag1 = "true2"
session("wm_usrname") = ""
session("wm_password") =""
else
session("wm_id") = rs("id")
session("wm_stat") = rs("stat")
end if
end if
'response.write session("hhrcstat")
rs.close
if flag1 = "true1" then
%>

<%
cflag = 1
i = 1
numrows = 0
ctype = ""
While NOT rs.EOF and NumRows < rs.Pagesize
sql = "select id,company from wm_com_detail where id = '" + rs("comid") + "'"

rs2.open sql,conn,1,1
if not rs2.eof then
sql = "select station from wm_job_detail where com_id = '" + rs2("id") + "'"

rs3.open sql,conn,1,1
rownum = 0
str = ""

while not rs3.eof
if str = "" then
sql = "select name from wm_station where id = '" + rs3("station") + "'"

set rs4 = Cmd.Execute
if not rs4.eof then
str = rs4("name")
end if
rs4.close
else
sql = "select name from wm_station where id = '" + rs3("station") + "'"

set rs4 = Cmd.Execute
if not rs4.eof then
str = str + ", " + rs4("name")
end if
rs4.close
end if
rs3.movenext
wend
rs3.close
if cflag = 0 then
colortype = "bgcolor='#eeeeee'"
else
colortype = ""
end if
qrydetail = " <a href = 'show_recieve.asp?code=" + rs2("id") + "'>"
%>

<%
end if
rs.moveNext
i = i + 1
if cflag = 0 then
cflag = 1
else
cflag = 0
end if
str = ""
numrows = numrows + 1
Wend
%>

<%
end if
rs.close
%>

<%
end if
end if
set Rs=nothing
set Rs2=nothing
set Rs3=nothing
set Rs4=nothing
Conn.Close
set Conn = nothing
%>