四散的尘埃吧资源:0x800A01A8怎么解决?

来源:百度文库 编辑:高校问答 时间:2024/05/08 18:04:54
<!--#include file="CommonCode.asp"-->
<%
dim cpbh,myres
cpbh=request.form("ProductNum")

mySQL="select * from PE_Product where productid='" & cpbh& "'"
set myRes=myconn.execute(mySQL)

if myres.bof and myres.eof then
response.write"产品编号不存在"
else
%>

<%=productid %>
<%=productname %>
.................
<%end if%>
到set myRes=myconn.execute(mySQL) 这行出的问题.请问如何解决?
我是想做一个查询数据库的代码.就是在商城里加一个编码的搜索.
下面是整套查询程序.帮我看看是那里出了毛病.
第一步:打开数据库
connn.asp
<%
dim connstr,mysql,myconn
connstr="provider=microsoft.jet.oledb.4.0;data source="& server.mappath("database\zjh@#.mdb")
set myconn=server.createobject("adodb.connection")
myconn.connectionstring=connstr
myconn.open
%>
第二步:提交查询页面
index.asp
<form method="POST" action="chaxun.asp">
<p>输入产品号:<input type="text" name="ProductNum" size="20">
<input type="submit" value="提交" name="Submit"><input type="reset" value="重置" name="B2"></p>
</form>

第三步:显示查询结果
chaxun.asp

<!-- #include file=connn.asp -->
<%

dim cpbh
cpbh=request.form("ProductNum")

mySQL="select * from pe_product where productid='" & cpbh& "'"
set myRes=myconn.execute(mySQL)

if myres.bof and myres.eof then
response.write"产品编号不存在"
else
%>

<%=ProductNum %>
<%=ProductName %>
.................
<%end if%>