第一个文件:
<!--#include file="adovbs.inc" -->
<%
dim Objconn
function Getrecordset(Filename,Tablename)
set Objconn=Server.Createobject("adodb.connection")
Objconn.Connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath(Filename)
set GetRecordset=Server.Createobject("adodb.recordset")
GetRecordset.Open TableName, objConn, adOpenKeyset, adLockOptimistic, adCmdTable
end function
%>
第二个文件
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<!--#include file="adofunctions.asp" -->
<%
dim objrs
Set objrs = getrecordset("books","留言板")
objRS.Open "留言板",objConn, adOpenKeyset, adLockOptimistic, adCmdTable
if Not objrs.eof Then
response.write "作者:" & objrs("作者") & "<BR>"
response.write "主题:" & objrs("主题") & "<BR>"
response.write "内容:" & objrs("内容") & "<BR>"
response.write "时间:" & bojrs("时间") & "<BR>"
Else
response.Write "到达数据库的结尾,无法显示记录。"
end if
objrs.close
set objrs=nothing
objconn.close
set objconn=nothing
%>
</body>
</html>
调试总是出错,错在哪呢???请高手帮帮忙,我都想了2天还没解决呀
看看错在哪,我研究2天还是找不出来