房屋使用说明书:请帮忙看看这个程序为什么不能运行?

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 08:51:05
这是毕业设计中的一个聊天程序,里面有几个页面,运行的时候总是打不开。这两天要交了。拜托大家帮帮忙,帮修改一下。谢谢!
其中的页面分别为:
enter.asp
<!--#include file="util.asp"-->
<%
name=request("name")
session("name")=name
if application(name)="ln"then
session("errmsg")="此一姓名(别名)已经被占用,"
response.redirect"main.asp"
else
session("errmsg")=""
application(name)="ln"
session.timeout=1
response.redirect"frame.htm"
end if
%>

talk.asp
<!--#include file="util.asp"-->
<% if request("send")="send" then
dbpath=server.MapPath("chatroom.mdb")
set conn=server.CreateObject("ADODB.Connection")
conn.open"driver={Microsoft Access Driver(*.mdb)};dbq="&dbpath
name=session("name")
sql="insert into chatroom(姓名,内容)value("
sql=sql&sqlstr(name)&","
sql=sql&sqlstr(request(""words"))&")
conn.execute sql
words="已加入聊天室!"
end if%>
<html>
<head>
<title><过程检测与仪表>在线答疑</title>
<base target="_self">
</head>
<body background="">
<form action="talk.asp" method="post">
<input type="hidden" name="send" value="send"><table>
<tr>
<td valign="top"><font color="#0000ff">聊天内容:</font><p><font color="#0000ff">
<input type="submit" value="提交"></font></td>
<td><font color="#0000ff">
<textarea name="words" rows="3" cols="40"><%=words%>
</textarea>
</font></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</form>
</body>
</html>

util.asp
<% sub addtonamelist(name.namelist)
if len(namelist)= 0 then
namelist=name
elseif instr(namelist,name)<=0 then
namelist=namelist &","&name
end if
end sub
function sqlstr(data)
sqlstr="'"&replace(data,"'","'")&"'"
end function %>

view.asp
<!--#include file="util.asp"-->
<% dbpath=server.MapPath("chatroom.mdb")
set conn=server.CreateObject("ADODB.Connection")
conn.open"driver={Microsoft Access Driver(*.mdb)};dbq"&dbpath
name=session("name")
set rs=conn.execute("最近十条谈话")
freq=session("freq")
if freq<=0 then freq=30
url=request.ServerVariables("path_info")%>
<html>
<head>
<meta http-equiv="refresh"content="<%=freq%>">
<meta http-equiv="content-type"
content="text/html;charset=gb_2312-80">
<meta name="generation" content="Microsoft frontpage 4.0">
<title><过程检测与仪表>在线答疑</title>
<base target="_self">
</head>
<body background="">
<h2 align="center"><font color="#800080"face="华文行揩" size="6">欢迎进入在线答疑系统</font> </h2>
<hr>
<table border="0">
<%while not rs.eof%>
<tr>
<td valign="top"><font color="#0000ff"><%=formatdatetime(rs("时间"),vbshorttime)%></font></td>
<td valign="top"><font color="#ff0000">(<%=rs("姓名")%>)说:
</font></td>
</tr>
<tr>
<td></td>
<td><%=replace(""&rs("内容"),vbcrlf,"<br>")%></td>
</tr>
<% rs.movenext
wend % ></table>
<hr>
</body>
</html>

调试信息呢? 估计没有人有时间把这些东西调试一遍的
我估计问题出在数据库的写入上 你要把你的数据库文件开放对“所有人”的写入、修改、读取权限才可以进行insert的操作 先关闭简单共享吧(如果是xp的话) 然后对这个文件添加“所有人”的权限 具体的用“可更新的查询”为关键字baidu一下 有很多结果