fso的write的问题

wwwxxb40000 2008-12-26 06:48:38
if rs("SEMI_YEAR")=NULL then
f.Write("-9999")
f.Write(",")
else
f.Write(rs("SEMI_YEAR"))
response.Write(rs("SEMI_YEAR"))
end if
---------------------------

rs("SEMI_YEAR")是11,类型为字符

response.Write(rs("SEMI_YEAR"))可以显示
--------------------------

错误信息是

Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'Write'

/exput_dir.asp,行 60

--------------

请教高手帮助


...全文
131 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwxxb40000 2008-12-28
  • 打赏
  • 举报
回复

解决了,是ISNULL()的问题

还是给分
jiang_jiajia10 2008-12-26
  • 打赏
  • 举报
回复
UP
liuhaibing0903 2008-12-26
  • 打赏
  • 举报
回复
写文件时判断:1.文件是否存在;2,文件是否以可写方式打开
luozhy 2008-12-26
  • 打赏
  • 举报
回复
来晚了
umwelt99 2008-12-26
  • 打赏
  • 举报
回复
我说怎么写入fso会用response这个对象都不对.
response.write是服务器端输出.1楼正确
必须要用FileSystemObject才行三
GHOSTSEA 2008-12-26
  • 打赏
  • 举报
回复
楼上正解。
dgboby 2008-12-26
  • 打赏
  • 举报
回复


response.charset="gb2312"
dim files,fso,th,sfs,content
files="alert.html"
set fso = Server.CreateObject("Scripting.FileSystemObject")
th=server.mappath(files)
if not fso.FileExists(th) then
openfile="<font color=#ff0000 size=2pz><br>read xml error<br>"
set fso=nothing
end if
set sfs=fso.opentextfile(th,8,false) '2重写,8追加记录
if request("SEMI_YEAR")="" then
sfs.write("-9999,")
else
sfs.Writeline("http://www.jatxw.cn")
end if
sfs.close
set sfs=nothing
set sfo=nothing


28,391

社区成员

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

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