主页面:
<!--#include file="conn.asp"--> <!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" lang="gb2312"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta http-equiv="Content-Language" content="gb2312" /> <link rel="stylesheet" rev="stylesheet" href="css/bg.css" type="text/css" media="all" /> <title>海泰经贸有限公司 </title> <link href="css/indexlayout.css" rel="stylesheet" type="text/css" /> <link href="css/menu.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="content"><div id="top2"><img src="image/top.gif" alt="top" width="760" height="124" /></div> <div class="ml_index" id="submenu"> <ul> <li id="one"><a title="首页" href="main.htm">首页</a></li> <li id="two"><a title="关于海泰" href="about.htm">关于海泰</a></li> <li id="three"><a title="产品展示" href="product.htm">产品展示</a></li> <li id="four"><a title="新闻中心" href="news.htm">新闻中心</a></li> <li id="five"><a title="客户服务" href="ser.htm">客户服务</a></li> <li id="six"><a title="客户反馈" href="feedback.htm">客户反馈</a></li> <li id="seven"><a title="心情驿站" href="rest.htm">心情驿站</a></li> <li id="eight"><a title="网站地图" href="sitmap.htm">网站地图</a></li> </ul> </div> <div><img src="image/flasha.jpg" width="760" height="240" /></div><div id="d2"> <div id="d-2-1">海泰网站测试中<br /> 海泰网站测试中 <br /> 海泰网站测试中<br /> 海泰网站测试中<br /> 海泰网站测试中</div> <% sql="select top 6 * from news where cateid='8' order by id DESC" set rs=server.createobject("adodb.recordset") rs.open sql,conn,3,3 if rs.eof then else do while not rs.eof%> <img src="wen.gif" width="9" height="7"> <%if len(rs("title"))>10 then title=left(rs("title"),10) %> <a href='javascript:opennew(<%=rs("cateid")%>)'> <%response.write " <font size='2'>" & title & "</font>"%>……</a><font size="2"> <font color="#cccccc">[<%=rs("addtime")%>]</font> <%else%> <a href='javascript:opennew(<%=rs("cateid")%>)'><%=rs("title")%></a> <font color="#cccccc">[<%=rs("addtime")%>]</font> <%end if%> </font> <br> <%rs.movenext loop end if rs.close %> </div> <div id="d3"><a href="sitmap.htm">网站地图</a> <a href="lianxi.htm">联系我们</a> </div> </div> </body> </html>
conn.asp:
<% dim conn dim connstr 'on error resume next call conn_init()
sub conn_init() 'on error resume next
connstr = "DBQ=" + server.mappath("news.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" set conn=server.createobject("ADODB.CONNECTION") if err.number<>0 then err.clear set conn=nothing response.write "数据库连接出错!" Response.End else 'response.write connstr conn.open connstr if err then err.clear set conn=nothing response.write "数据库连接出错!" Response.End end if end if end sub sub endConnection() conn.close set conn=nothing end sub %>
报错:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft OLE DB Provider for ODBC Drivers
[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。
/ht/main1.asp,行35
各位大虾,紧急求助。