Microsoft vb-script 编译器错误 错误 '800a03f6' ,不知问题在哪里

fxbb 2004-11-06 02:07:45
我在实验室环境下测试我做的程序没有问题,但是拿到别人服务器上就是有问题。我实现的是利用FSO在服务器端生成一个EXCEL文件然后下载到客户端,为什么会出现这个问题呢?
Microsoft vb-script 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft vb-script 运行时错误 错误 '800a0046'

没有权限

/hkxtweb/2excel1.asp,行13

主要出错代码如下:

<%@ LANGUAGE="VBSCRIPT" %>
<%option explicit%>
<%
dim rs,sql,filename,fs,myfile,x,link,conn,DSNtemp,table,f,intFilelength,s
Set conn = Server.CreateObject("ADODB.Connection")
DSNtemp="driver={SQL Server};database=QHSy;server=localhost;uid=sa;pwd=sa"
conn.open DSNtemp
Set fs = server.CreateObject("scripting.filesystemobject")
filename = Server.MapPath("/")+"\\online.xls"
if fs.FileExists(filename) then
fs.DeleteFile(filename)
end if
set myfile = fs.CreateTextFile(filename,true)//我猜测主要是这句有问题
Set rs = Server.CreateObject("ADODB.Recordset")
sql = unescape(request.querystring("sql"))
table = request.querystring("title")
rs.open sql,conn,1,1
if rs.EOF and rs.BOF then
...全文
304 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluemoon0001 2004-11-10
  • 打赏
  • 举报
回复
如果是他们给fso改名注册的话,错误提示就不是没有权限了,应该是创建对象时ID出错。
bluemoon0001 2004-11-10
  • 打赏
  • 举报
回复
上面掉了一个字:

问题解决了吗?其实非NTFS也是有安全管理权限的,
bluemoon0001 2004-11-10
  • 打赏
  • 举报
回复
问题解决了吗?其实NTFS也是有安全管理权限的,告诉你一件怪事(说是怪事其实是想不通为什么),我前几天做一个网站也用到fso,在我机子上没有问题,传到服务器上不行(2003,NTFS分区),到服务器上看一下那个上传文件的文件夹(我们的管理员可以远程操作服务器),everyone的写入权限被限制,用administrator的身份进服务器去改也改不了,最后把那个文件夹在服务器上重新复制一下,再看everyone权限为完全控制,然后把原来的那个文件夹删了,再把备份的文件夹改成原文件夹的名称就OK了;所以我怀疑是不是你那个服务器的管理员不会改文件夹everyone的控制权限。
bluemoon0001 2004-11-08
  • 打赏
  • 举报
回复
你问他们,为什么,在你自己的机子上没有问题,到他们服务器上就有问题了,不就行了吗?
bluemoon0001 2004-11-08
  • 打赏
  • 举报
回复
他们服务器一定存在问题,让他们检查一下设置,虽然非NTFS不存在,但是他们可以人为的去设,让他们设一下文件夹的everyone的权限,别管他什么分区。
fxbb 2004-11-08
  • 打赏
  • 举报
回复
呵呵怎么说话的口气那么象我认识的一个人
bluemoon0001(小天--五星级的菜鸟) 要是真的把这个问题解决了我们交个朋友,我再给你100分
会不会是他们弄了什么组件我不知道的,才会有这样的错误?我是新手哈
fxbb 2004-11-07
  • 打赏
  • 举报
回复
关键是他们把程序放在非NTFS分区下面测试了也还是存在这个问题啊!在非NTFS分区下面是不存在权限问题的,但是他们的反馈信息说的是问题依旧存在
lonelydreamsym 2004-11-07
  • 打赏
  • 举报
回复
缺少权限是真正的错误,看分区有everyone权限和站点有没有匿名权限
bluemoon0001 2004-11-06
  • 打赏
  • 举报
回复
是你要写的文件夹的安全属性,昨天我也遇到过,NTFS,2003操作系统,当我往数据库中提交数据时,说我没有权限,后来在access数据库的安全属性中把everyone改成完全控制就行,你的代码没有问题,在你机子上都可以,那就是服务器的那个文件夹的安全属性中为只读,不能写入了,改那个文件夹的安全属性。
fxbb 2004-11-06
  • 打赏
  • 举报
回复
我把代码帖出来请兄弟们帮我看看会不会是下面那个if rs.EOF and rs.BOF then。。。else。。。if 应该改成if rs.EOF and rs.BOF then。。。elseif??
if rs.EOF and rs.BOF then
else
dim strLine,responsestr
strLine=""
if (table = "T_KC") then
myfile.writeline "正式物资库存情况表"
strLine = strLine & "库房名称" & chr(9)
strLine = strLine & "物资编码" & chr(9)
strLine = strLine & "物资名称" & chr(9)
strLine = strLine & "规格型号" & chr(9)
strLine = strLine & "计量单位" & chr(9)
strLine = strLine & "材质" & chr(9)
strLine = strLine & "单价" & chr(9)
strLine = strLine & "库存" & chr(9)
strLine = strLine & "金额" & chr(9)
strLine = strLine & "动态时间" & chr(9)
end if
if (table = "T_KC1") then
myfile.writeline "代储代销物资库存情况表"
strLine = strLine & "库房名称" & chr(9)
strLine = strLine & "物资编码" & chr(9)
strLine = strLine & "物资名称" & chr(9)
strLine = strLine & "规格型号" & chr(9)
strLine = strLine & "计量单位" & chr(9)
strLine = strLine & "材质" & chr(9)
strLine = strLine & "单价" & chr(9)
strLine = strLine & "代储厂家名称" & chr(9)
strLine = strLine & "有无协议" & chr(9)
strLine = strLine & "库存" & chr(9)
strLine = strLine & "金额" & chr(9)
strLine = strLine & "动态时间" & chr(9)
end if
if (table = "T_KC2") then
myfile.writeline "委托代理物资库存情况表"
strLine = strLine & "库房名称" & chr(9)
strLine = strLine & "物资编码" & chr(9)
strLine = strLine & "物资名称" & chr(9)
strLine = strLine & "规格型号" & chr(9)
strLine = strLine & "计量单位" & chr(9)
strLine = strLine & "材质" & chr(9)
strLine = strLine & "单价" & chr(9)
strLine = strLine & "代理厂家名称" & chr(9)
strLine = strLine & "库存" & chr(9)
strLine = strLine & "金额" & chr(9)
strLine = strLine & "动态时间" & chr(9)
end if
if (table = "T_KC3") then
myfile.writeline "正式物资库存情况表"
strLine = strLine & "库房名称" & chr(9)
strLine = strLine & "物资编码" & chr(9)
strLine = strLine & "物资名称" & chr(9)
strLine = strLine & "规格型号" & chr(9)
strLine = strLine & "计量单位" & chr(9)
strLine = strLine & "材质" & chr(9)
strLine = strLine & "库存" & chr(9)
end if
if (table = "T_KC4") then
myfile.writeline "代储代销物资库存情况表"
strLine = strLine & "库房名称" & chr(9)
strLine = strLine & "物资编码" & chr(9)
strLine = strLine & "物资名称" & chr(9)
strLine = strLine & "规格型号" & chr(9)
strLine = strLine & "计量单位" & chr(9)
strLine = strLine & "材质" & chr(9)
strLine = strLine & "代储厂家名称" & chr(9)
strLine = strLine & "有无协议" & chr(9)
strLine = strLine & "库存" & chr(9)
end if
if (table = "T_KC5") then
myfile.writeline "委托代理物资库存情况表"
strLine = strLine & "库房名称" & chr(9)
strLine = strLine & "物资编码" & chr(9)
strLine = strLine & "物资名称" & chr(9)
strLine = strLine & "规格型号" & chr(9)
strLine = strLine & "计量单位" & chr(9)
strLine = strLine & "材质" & chr(9)
strLine = strLine & "代理厂家名称" & chr(9)
strLine = strLine & "库存" & chr(9)
end if
myfile.writeline strLine
Do while Not rs.EOF
strLine=""
for each x in rs.Fields
if (x.name = "F_WZBM") then
strLine = strLine & cstr(x.value) & chr(14)
strLine = strLine & " " & chr(9)
else
strLine= strLine & x.value & chr(9)
end if
next
myfile.writeline strLine
rs.MoveNext
loop
end if

rs.Close
set rs = nothing
conn.close
set conn = nothing
set myfile = nothing

Response.Buffer = True
Response.Clear
Set s = Server.CreateObject("ADODB.Stream")
s.Open
s.Type = 1
on error resume next
filename = Server.MapPath("/")+"\\online.xls"
Set f = fs.GetFile(filename)
intFilelength = f.size
s.LoadFromFile(filename)
if err then
Response.Write("<h1>Error: </h1>" & err.Description & "<p>")
Response.End
end if
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
Response.AddHeader "Content-Length", intFilelength
Response.CharSet = "UTF-8"
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite s.Read
Response.Flush
s.Close
Set s = Nothing
fs.close
Set fs=Nothing
%>
fxbb 2004-11-06
  • 打赏
  • 举报
回复
由于我是给外地的公司做的,所以只能给他们说怎么做,bluemoon0001(小天--五星级的菜鸟) 说的我已经给他们说过,他们也放在非NTFS分区的磁盘下面测试了还是有问题,我想问题肯定出在权限设置上,但是到底是怎么回事呢?
bluemoon0001 2004-11-06
  • 打赏
  • 举报
回复
改那一个文件夹的属性就行了,其它的不要改,这样安全点。
bluemoon0001 2004-11-06
  • 打赏
  • 举报
回复
服务器文件夹的权限被设为只读的了,所以说你没有权限,改在下服务器上的你要写文件的那个文件夹的安全属性,把everyone的权限改为可写的就行了。
fxbb 2004-11-06
  • 打赏
  • 举报
回复
那台服务器系统所在盘是NTFS分区的,请问需不需要将某些DLL的安全属性设置为EVERYONE-“完全控制”

28,404

社区成员

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

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