Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>检索数据库记录子程序的代码</title>
</head>
<body bgcolor="#99FF99">
<center>
<%
set conn=server.CreateObject("adodb.connection")
conn.open "test"
set rs=server.CreateObject("adodb.recordset")
sqlstmt="select * from student"
rs.open sqlstmt,conn
if rs.eof then
response.Write("<center>数据库中没有记录,")
response.Write("<br>请检查数据库!</center>")
else
%>
<h1><b><i>检索数据库记录的例子</i></b></h1>
<hr>
<table width="603" border="1" cellpadding="10" height="10">
<tr><td align="center" width="143"><b><font size="+1" color="#000000">姓名</font></b></td>
<td bgcolor="#0066FF" align="center" width="108">
<b>
<font size="+1" color="#000000">性别</font>
</b>
</td>
<td width="126" valign="top" align="center">
<font size="+1"><b>班级</b></font>
</td>
<td width="126" valign="top" align="center">
<font size="+1"><b>成绩</b></font>
</td>
</tr>
<%
do while not rs.eof
name=rs("name")
classname=rs("class")
sex=rs("sex")
score=rs("score")
%>
<tr>
<td height="1" width="143" align="center">
<%=name%>
</td>
<td height="1" width="108" bgcolor="#99FF00" align="center">
<font size="+3"><font color="#000000"><b>
<%=sex%></b></font></font></td>
<td height="1" width="126" align="center"><font size="+3"><b><%=classname%></b></font></td>
<td height="1" width="126" align="center"><font size="+3"><b><%=score%></b></font></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
</table>
</center>
</body>
</html>
数据库:"student.mdb"已经驱动了,可是运行出错conn后面接数据库名吗?还是目录文件名:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
[Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
/lx/626/list.asp,行 13