帮我看看吧,sql数据库换成access出错了!
iwo99 2002-03-21 09:17:52 我原来用asp+sql作了一个程序,现在我想换成sql+access但是我把数据库连接换了后就不稳定了,老是出Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)的错误。我不知道为什么,是不是光换数据库连接文件不行,还有其它
的注意事项,恳请各位高手帮忙!!谢谢!!!
以下有一个错误原码,高手们帮帮忙吧!!!!!!!!!!!
conn.asp
<%
set conn=server.createobject("adodb.connection")
strconn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../include/book98.mdb")
conn.open strconn
%>
left.asp
<html>
<head>
<!-- #include file="../include/conn.asp" -->
<!--#include file="../include/adovbs.inc"-->
<!-- #include file="../include/css.css" -->
<script>
function focusit()
{
document.all("input").focus();
}
</script>
<title>所 有 分 类</title>
<base target="main">
</head>
<body onload="focusit()" background="../image/back_file.gif">
<div align="center">
<center>
<table border="1" width="55%" cellspacing="0" cellpadding="0" bordercolorlight="#99CCFF" bordercolordark="#FFFFFF" bgcolor="#E3FEDA">
<tr>
<td width="100%">
<form method="post" action="show.asp">
<br>
<select size="1" name="chaxun">
<option >按书名查</option>
<option>按作者查</option>
<option>按主题词查</option>
<option selected>模糊查询</option>
</select><br> <input type="text" name="input" size="12" style="width: 84; height: 20"><input type="submit" value="查询" name="查询" style="width: 34; height: 20">
</form>
</td>
</tr>
</table>
</center>
</div>
<TABLE cellSpacing=0 cellPadding=0 width="134" align=center
border=1 height="281" bgcolor="#CBE6B9" bordercolorlight='#99CCFF' bordercolordark='#FFFFFF' cellspacing=0>
<TR>
<TD height=29 width="132" bgcolor="#FFCC99">
<b><font size="2" color="#0000FF">所 有 分 类</font></b></TD></TR>
<%
sql="select * from fenlei"
set rs=conn.execute(sql)
do while not rs.eof
%>
<TR>
<TD bgColor=#E3FEDA height="28" width="132"> <font size="2"><a href="show.asp?fenlei=<%=rs("分类号")%>"><%=rs("分类名称")%></a>(<font color=red>
<%
sql1="select count(*) from book where 分类号='"&rs("分类号")&"'and 权限='1'"
set rs1=conn.execute(sql1) ..........出错行!!!!!
response.write rs1(0)
%></font>)</font> </TD></TR>
<TR>
<% rs.movenext
loop
conn.close
set rs=nothing
set rs1=nothing
set conn=nothing
%>
<TR>
<TD bgColor=#FFCC99 height="28" width="132"> </TD></TR>
</TABLE>
</body>
<html>
出错提示:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
/book98/student/left.asp, 第 67 行
拜托各位了,谢谢!!!!!!
类似这样的问题很多,我不知道是哪里错了,帮帮忙高手急啊!!!