刚学asp ,看了好久都没有发现问题,请教“为什么就运行不了呢”
conn.asp的代码<%
title2="On the road"
'下面是数据库连接语句
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("database/start.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
-----------------------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from news order by id desc"
rs.open sql,conn,1,1
%>
<table width="466" height="101" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<%
do while not rs.eof
%>
<table width="409" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="176"><%=rs("typename")%></td>
<td width="233"><%=rs("title")%></td>
</tr>
</table>
<%rs.movenext
loop%>
</td> </tr>
</table>
<%rs.close
set rs =nothing
%>
</body>
</html>