为什么运行不起来亚

kingzd 2004-04-11 04:26:42
下面是代码,服务器已经支持写入


<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
dim sql,rs
dim id,title,thisdate,writer,text
dim begin
begin=request.QueryString("begin")

if begin="" then
sql="select * from a where"
else
sql="select * from a where id>="&begin
end if

set rs = server.CreateObject("adodb.recordset")

rs.open sql,conn,1,1

id=rs("id")&".xml"
title=rs("title")
text=rs("text")
thisdate=rs("thisdate")
writer=rs("writer")

Dim xfso,xts,outxml

Set xfso = Server.CreateObject("Scripting.FileSystemObject")
do not while rs.eof
xfso.CreateTextFile(id)
set xts=xfso.OpenTextFile(id)

outxml="<?xml version='1.0' encoding='gb2312'?>"&vbnewline
outxml=outxml&"<?xml-stylesheet type='text/xsl' href='a.htm'?>"&vbnewline
outxml=outxml&"<root>"&vbnewline
outxml=outxml&"<title>"&title&"</title>"&vbnewline
outxml=outxml&"<text>"&text&"</text>"&vbnewline
outxml=outxml&"<thisdate>"&thisdate&"</thisdate>"&vbnewline
outxml=outxml&"<writer>"&writer&"</writer>"&vbnewline
outxml=outxml&"</root>"

xts.write(outxml)
loop
xts.close

set xts=nothing
set xfso=nothing
set conn=nothing
%>
...全文
57 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qihboy 2004-04-17
  • 打赏
  • 举报
回复
dim fso,f
set fso= Server.CreateObject("scripting.filesystemobject")
set f=fso.opentextfile(server.MapPath("文件名.xml"),2,true)
f.write body

body=你写入那个文件的内容
kingzd 2004-04-17
  • 打赏
  • 举报
回复
那个我已经改过来啦,请问一下FSO得写入那一块怎么用,可以给以个例子么?我用.write命令不行
qihboy 2004-04-17
  • 打赏
  • 举报
回复
第一句SQL查询语句干什么要加个WHERE啊?
空闲独处 2004-04-17
  • 打赏
  • 举报
回复
不知道什么叫运行不起来?是不能运行呢,还是有错误?
kingzd 2004-04-17
  • 打赏
  • 举报
回复
不行亚
mustapha 2004-04-12
  • 打赏
  • 举报
回复
if begin="" then
sql="select * from a where"
else
当中一句应该没有where吧

28,390

社区成员

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

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