我不知道是怎么回事,谁帮了我,我给高分!

aqiu 2001-05-16 03:52:00
<!--#include file="images\adovbs.inc"-->
<%
username=Request("username")
userpsd =Request("userpsd")
comment =Request("comment")
if username<>"azhi" or userpsd<>" " or comment="" then
Response.Redirect("http://localhost")
Response.end
end if
set fso=Server.CreateObject("Scripting.FileSystemObject")
set Conn = Server.CreateObject("ADODB.Recordset")
Conn.Open "new","driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("images\new.mdb"),adOpenKeyset,adLockOptimistic
Conn.addnew
Conn("dates")=Date()
Conn("says")=comment
Conn.update
Conn.close
sql="select top 5 * from new order by dates DESC"
Conn.Open sql,"driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("images\new.mdb")
f.writeline "m=''"
while NOT Conn.EOF
f.writeline "m+='"&Conn("dates")&" "&Conn("says")&"<br>';"
Conn.movenext
wend
f.writeline "document.write(m);"
Conn.close
%>
<html>
<a href=add.htm>继续添加</a>
<a href=../index.htm>返回首页</a>
</html>



这是一个自动更新的源程序,一个html的表单文件,提交后,结果能看得到,但是说缺少对象: 'f' ,为什么呀?
大家帮帮我
aqiu@126.com,497663
...全文
68 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
BrentIvan 2001-05-16
  • 打赏
  • 举报
回复
帖子列表旁边有个管理,加分要输入密码
aqiu 2001-05-16
  • 打赏
  • 举报
回复
我该怎么给你们加分?我加了,但不行
西门吹雪 2001-05-16
  • 打赏
  • 举报
回复
Agree with BrentIvan
tlovexyj 2001-05-16
  • 打赏
  • 举报
回复
从这起,f是哪来的?

f.writeline "m=''"
while NOT Conn.EOF
f.writeline "m+='"&Conn("dates")&" "&Conn("says")&"<br>';"
Conn.movenext
wend
f.writeline "document.write(m);"
Conn.close
%>
BrentIvan 2001-05-16
  • 打赏
  • 举报
回复
f.writeline "m=''"
这里f应该是一个TextStream对象,但你没用创建对象就直接使用了。
可以这样:在前面加上
Set f = fso.CreateTextFile("c:\f.txt", True)

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧