为什么显示不出来!!
我刚开始写ASP程序,现有如下的ASP文件,编译时显示不出来?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("mynews.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" '连接一个access的数据库
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<%
const MaxPerPage=10 '定义一个常量 maxperpage
dim i
dim sql
dim rs
dim typeid
i=0
%>
<%
sql="select * from article where typeid='16' "
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
do while NOT rs.EOF
response.write( rs("title"))
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
set rs=nothing
set conn=nothing
%>
</body>
</html>