出现如下错误: Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e0c' ,没有为命令对象设置命令 ,/singlequery/result.asp, 行59

jisouth_ls74112 2002-12-16 11:37:16
平台:win98+pws+access


请高手指教!!
...全文
665 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
xcgh 2002-12-16
  • 打赏
  • 举报
回复
把连接改成ACESS试一试
SET CONN=SERVER.CREATEOBJECT("ADODB.CONNECTION")
CONN.OPEN "DRIVER={MICROSOFT ACCESS DRIVER (*.MDB)};DBQ=" & SERVER.MAPPATH("你的数据库名")
SET RS=SERVER.CREATEOBJECT("ADODB.RECORDSET")
SQLSTRING="SELECT * FROM XXX"
RS.OPEN SQLSTRING,CONN,1,3

你要注意一点,在SQL里面,有一些SQL语句和在ACCESS里是不一样的,比如:在SQL里面支持 Left Outer Join但是在ACCESS里是不支持的,再如:
SQL里Delete from XXX,但是在ACCESS里必须是 Delete * form XXX
刚学的
dengwei7909 2002-12-16
  • 打赏
  • 举报
回复
我认为是你打开纪录集是出错了,也许是纪录集重名了,你在还没有关闭第一个纪录集时,又打开同名的第二个纪录集,就会出现Microsoft OLE DB Provider for ODBC Drivers 错误 !你仔细看看
lbd8848 2002-12-16
  • 打赏
  • 举报
回复
执行sql语句后没有记录
jisouth_ls74112 2002-12-16
  • 打赏
  • 举报
回复
输出为空是什么意思?
逍遥小贼 2002-12-16
  • 打赏
  • 举报
回复
把你的sql语句输出看看,是否为空,我估计是空的
flbz 2002-12-16
  • 打赏
  • 举报
回复
dim conn
dim connstr
dim DBPath
DBPath = "/jntm.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
ssm1226 2002-12-16
  • 打赏
  • 举报
回复
response.write sele_db

看不是为空
jisouth_ls74112 2002-12-16
  • 打赏
  • 举报
回复
这是程序2(result.asp):
<%Response.Buffer =true%>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<link rel="stylesheet" type="text/css" href="../other/css/style.css">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>result</title>
<STYLE type=text/css>TD {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
BODY {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
SELECT {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
A {
COLOR: #004160; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff0000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: underline
}
.p11 {
COLOR: #0080c0; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
</STYLE>

<%
Set Conn=Server.CreateObject("ADODB.Connection")
connstr="DBQ="+server.mappath("/jntm.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
Conn.Open connstr
sqrmc=request.form("sqrmc")
sbmc=request.form("sbmc")
sblb=request.form("sblb")
jfqk=request.form("jfqk")
dlr=request.form("dlr")
cxr=request.form("cxr")

button=request.form("button")
select case button
case "按申请人名称查询 "
sele_db = "select * from query where sqrmc like '%"&sqrmc&"%' "
case "按商标名称查询"
sele_db = "select * from query where sbmc like '%"&sbmc&"%' "
case "按商标类别查询"
sele_db = "select * from query where sblb ='"&sblb&"' "
case "按交费情况查询"
sele_db = "select * from query where jfqk ='"&jfqk&"' "
case "按代理人查询"
sele_db = "select * from query where dlr ='"&dlr&"' "
case "按国家局查询人查询"
sele_db = "select * from query where cxr ='"&cxr&"' "
end select
set dbls=conn.Execute(sele_db)
%>
</head>

<body background="../image/back1.gif" bgproperties="fixed">

<p><br>
</p>
<p align="center"><font color="#008080" size="2">按“查询人名称”查询结果如下:</font> </p>
<table border=1 bordercolor="#999999" width="763">
<tr bgcolor="#000000">
<td height="2" align="center"><font color="#FF9900">申请人名称:</font></td>
<td height="2" align="center"><font color="#FF9900">商标名称:</font></td>
<td height="2" align="center"><font color="#FF9900">商标类别:</font></td>
<td height="2" align="center"><font color="#FF9900">联系人:</font></td>
<td height="2" align="center"><font color="#FF9900">电话(含地区号):</font></td>
<td height="2" align="center"><font color="#FF9900">查询日期:</font></td>
<td height="2" align="center"><font color="#FF9900">交费情况:</font></td>
<td height="2" align="center"><font color="#FF9900">交费日期:</font></td>
<td height="2" align="center"><font color="#FF9900">代理人:</font></td>
<td height="2" align="center"><font color="#FF9900">国家局查询人:</font></td>
</tr>
<% do while not dbls.eof %>
<tr>
<td> <%=dbls("sqrmc")%> </td>
<td> <%=dbls("sbmc")%> </td>
<td> <%=dbls("sblb")%> </td>
<td> <%=dbls("lxr")%> </td>
<td> <%=dbls("tel")%> </td>
<td>200<%=dbls("cyear")%>年<%=dbls("cmonth")%>月<%=dbls("cday")%>日 </td>
<td> <%=dbls("jfqk")%> </td>
<td>200<%=dbls("jyear")%>年<%=dbls("jmonth")%>月<%=dbls("jday")%>日 </td>
<td> <%=dbls("dlr")%> </td>
<td> <%=dbls("cxr")%> </td>
</tr>
<% dbls.movenext
loop
dbls.close
conn.close
%>
</table>

</body>
</html>





jisouth_ls74112 2002-12-16
  • 打赏
  • 举报
回复
这是程序1(query1.htm):
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<link rel="stylesheet" type="text/css" href="../other/css/style.css">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>query</title>
<STYLE type=text/css>TD {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
BODY {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
SELECT {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
}
A {
COLOR: #004160; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff0000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: underline
}
.p11 {
COLOR: #0080c0; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
</STYLE>

</head>

<body bgproperties="fixed">
<p align="center"><font size="4"><b><font color="#800000"> <font color="#990000">商
标 信 息 单 项 查 询 </font></font><font color="#990000">系 统</font></b><font color="#3DA7F5"><br>
</font> </font> </p>
<form method="POST" action="result.asp">
<table width="75%" border="1" align="center">
<tr>
<td>
<div align="center">
<table border="0" width="169" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" height="1">
<tr>
<td height="28" align="center">
<p align="center"><b>
<input type="text" name="sqrmc" size="10">
<font color="#800000"></font></b></p>
<p align="center"> <b> </b><b>
<input type="submit" name=button value=按申请人名称查询 >
</b> </p>
</td>
</tr>
</table>
</div>
</td>
<td>
<div align="center">
<table border="0" width="169" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" height="1">
<tr>
<td height="28" align="center">
<p align="center"><b>
<input type="text" name="sbmc" size="10">
<font color="#800000"></font></b></p>
<p align="center"> <b> </b><b>
<input type="submit" value=按商标名称查询 name=button>
</b> </p>
</td>
</tr>
</table>
</div>
</td>
<td>
<div align="center">
<table border="0" width="169" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" height="1">
<tr>
<td height="27" bordercolor="#FFFFFF">
<p align="center">
<select size="1" name="sblb" >
<option><b>0</b></option>
<option><b>1</b></option>
<option><b>2</b></option>
<option><b>3</b></option>
<option><b>4</b></option>
<option><b>5</b></option>
<option><b>6</b></option>
<option><b>7</b></option>
<option><b>8</b></option>
<option><b>9</b></option>
<option><b>10</b></option>
<option><b>11</b></option>
<option><b>12</b></option>
<option><b>13</b></option>
<option><b>14</b></option>
<option><b>15</b></option>
<option><b>16</b></option>
<option><b>17</b></option>
<option><b>18</b></option>
<option><b>19</b></option>
<option><b>20</b></option>
<option><b>21</b></option>
<option><b>22</b></option>
<option><b>23</b></option>
<option><b>24</b></option>
<option><b>25</b></option>
<option><b>26</b></option>
<option><b>27</b></option>
<option><b>28</b></option>
<option><b>29</b></option>
<option><b>30</b></option>
<option><b>31</b></option>
<option><b>32</b></option>
<option><b>33</b></option>
<option><b>34</b></option>
<option><b>35</b></option>
<option><b>36</b></option>
<option><b>37</b></option>
<option><b>38</b></option>
<option><b>39</b></option>
<option><b>40</b></option>
<option><b>41</b></option>
<option><b>42</b></option>
<option><b>43</b></option>
<option><b>44</b></option>
<option><b>45</b></option>
</select>
<p align="center"> <b> </b><b>
<input type="submit" value=按商标类别查询 name=button>
</b> </p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td height="91">
<div align="center">
<table border="0" width="169" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" height="53">
<tr>
<td height="72" align="center">
<p align="center"><b>
<input type="text" name="jfqk" size="10">
<font color="#800000"></font></b></p>
<p align="center"><b>
<input type="submit" value=按交费情况查询 name=button>
</b></p>
</td>
</tr>
</table>
</div>
</td>
<td height="91">
<div align="center">
<table border="0" width="169" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" height="1">
<tr>
<td height="28" align="center">
<p align="center"><b>
<input type="text" name="dlr" size="10">
<font color="#800000"></font></b></p>
<p align="center"> <b> </b><b>
<input type="submit" value=按代理人查询 name=button>
</b> </p>
</td>
</tr>
</table>
</div>
</td>
<td height="91">
<div align="center">
<table border="0" width="169" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" height="1">
<tr>
<td height="28" align="center">
<p align="center"><b>
<input type="text" name="cxr" size="10">
<font color="#800000"></font></b></p>
<p align="center"> <b> </b><b>
<input type="submit" value=按国家局查询人查询 name=button>
</b> </p>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr bgcolor="#336699">
<td colspan="3" height="48">
<div align="center"><b>
<input type="reset" value="重新输入" name="B22">
<input type="button" name="B32" value="返回" onClick="window.history.back()">
</b></div>
</td>
</tr>
</table>
<p> </p>
</form>
<p>  </p>
</body>
</html>

quady 2002-12-16
  • 打赏
  • 举报
回复
把代码贴出来看看。
jisouth_ls74112 2002-12-16
  • 打赏
  • 举报
回复
我的连接数据库就是access!

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧