ADODB.Stream 错误 '800a0bb9' 参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

tuyee 2012-03-04 03:46:31
ADODB.Stream 错误 '800a0bb9'

参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

/inc/UpLoadClass.asp,行 101

101行=binForm.Write binRequestData

总是更新不了内容,出这个提示,请高手帮帮忙 看怎么解决,多谢了


<%
Class UpLoadClass

Private p_MaxSize,p_TotalSize,p_FileType,p_SavePath,p_AutoSave,p_Error
Private objForm,binForm,binItem,strDate,lngTime
Public FormItem,FileItem

Public Property Get Version
Version="Rumor UpLoadClass Version 2.0B"
End Property

Public Property Get Error
Error=p_Error
End Property

Public Property Get MaxSize
MaxSize=p_MaxSize
End Property
Public Property Let MaxSize(lngSize)
if isNumeric(lngSize) then
p_MaxSize=clng(lngSize)
end if
End Property

Public Property Get TotalSize
TotalSize=p_TotalSize
End Property
Public Property Let TotalSize(lngSize)
if isNumeric(lngSize) then
p_TotalSize=clng(lngSize)
end if
End Property

Public Property Get FileType
FileType=p_FileType
End Property
Public Property Let FileType(strType)
p_FileType=strType
End Property

Public Property Get SavePath
SavePath=p_SavePath
End Property
Public Property Let SavePath(strPath)
p_SavePath=replace(strPath,chr(0),"")
End Property

Public Property Get AutoSave
AutoSave=p_AutoSave
End Property
Public Property Let AutoSave(byVal Flag)
select case Flag
case 0:
case 1:
case 2:
case false:Flag=2
case else:Flag=0
end select
p_AutoSave=Flag
End Property

Private Sub Class_Initialize
p_Error = -1
p_MaxSize = 153600
p_FileType = "jpg/gif"
p_SavePath = ""
p_AutoSave = 0
p_TotalSize= 0
strDate = replace(cstr(Date()),"-","")
lngTime = clng(timer()*1000)
Set binForm = Server.CreateObject("ADODB.Stream")
Set binItem = Server.CreateObject("ADODB.Stream")
Set objForm = Server.CreateObject("Scripting.Dictionary")
objForm.CompareMode = 1
End Sub

Private Sub Class_Terminate
objForm.RemoveAll
Set objForm = nothing
Set binItem = nothing
if p_Error<>4 then binForm.Close()
Set binForm = nothing
End Sub

Public Sub Open()
if p_Error=-1 then
p_Error=0
else
Exit Sub
end if
Dim lngRequestSize,binRequestData,strFormItem,strFileItem
Const strSplit="'"">"
lngRequestSize=Request.TotalBytes
if lngRequestSize<1 or (lngRequestSize>p_TotalSize and p_TotalSize<>0) then
p_Error=4
Exit Sub
end if
binRequestData=Request.BinaryRead(lngRequestSize)
binForm.Type = 1
binForm.Open
binForm.Write binRequestData 这是错误提示行

Dim bCrLf,strSeparator,intSeparator
bCrLf=ChrB(13)&ChrB(10)

intSeparator=InstrB(1,binRequestData,bCrLf)-1
strSeparator=LeftB(binRequestData,intSeparator)
...全文
602 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tuyee 2012-03-04
  • 打赏
  • 举报
回复
这是我提交页写入代码:去掉上传代码就提示request2错误,请帮我改改,不要这段上传代码都行

<%@CODEPAGE="936"%>
<% If session("manager")="" Then
Response.Redirect("manage.asp")
Response.end
End If %>
<!--#include file="inc/conn2.asp"-->
<!--#include file="inc/UpLoadClass.asp"-->
<%
opendataconn
function douhao(kk)
douhao="'" & replace(kk,"'","''") & "'"
end function

Server.ScriptTimeout=999
'建立上传对象
dim request2,request3
set request2=New UpLoadClass
'上传总大小为2M
request2.TotalSize= 2097152
'单文件最大1M
request2.MaxSize = 1048576
'允许上传的格式
request2.FileType = "jpg/gif/bmp/png"
'上传路径
request2.SavePath= "../uppic/"
request2.open
pic=request2.Form("pic")
'***************************判断上传

set request3=New UpLoadClass
'上传总大小为2M
request3.TotalSize= 2097152
'单文件最大1M
request3.MaxSize = 1048576
'允许上传的格式
request3.FileType = "jpg/gif/bmp/png"
'上传路径
request3.SavePath= "../uppic/"
request3.open
pic2=request3.Form("pic2")

lx=trim(request2.Form("lx"))
userid=trim(request2.Form("userid"))
fyh=trim(request2.Form("fyh"))
fwyt=trim(request2.Form("fwyt"))
wuyue=trim(request2.Form("wuyue"))
fyxz=trim(request2.Form("fyxz"))
lou=trim(request2.Form("lou"))
gyr=trim(request2.Form("gyr"))
fyxz=trim(request2.Form("fyxz"))
lou=trim(request2.Form("lou"))
gyr=trim(request2.Form("gyr"))
xxlb=trim(request2.Form("xxlb"))
yxq=trim(request2.Form("yxq"))
fangwei=trim(request2.Form("fangwei"))
area=trim(request2.Form("area"))
zcenci=trim(request2.Form("zcenci"))
cenci=trim(request2.Form("cenci"))
fclx=trim(request2.Form("fclx"))
zhbz=trim(request2.Form("zhbz"))
zhprice=trim(request2.Form("zhprice"))
createyear=trim(request2.Form("year"))
chaoxiang=trim(request2.Form("chaoxiang"))
jiegou=trim(request2.Form("jiegou"))
fangwupeizhi=trim(request2.Form("fangwupeizhi"))
huzhu=trim(request2.Form("huzhu"))
sfz=trim(request2.Form("sfz"))
tel=trim(request2.Form("tel"))
dijia=trim(request2.Form("dijia"))
tengfangri=trim(request2.Form("tengfangri"))
weituoxingzhi=trim(request2.Form("weituoxingzhi"))
fydengji=trim(request2.Form("fydengji"))
yaoshi=trim(request2.Form("yaoshi"))
weituoshu=trim(request2.Form("weituoshu"))
lou=trim(request2.Form("lou"))
hetongbeizhu=trim(request2.Form("hetongbeizhu"))
menpaihao=trim(request2.Form("menpaihao"))
mianji=request2.Form("mianji")
mianji2=request2.Form("mianji2")
qianyueriqi=trim(request2.Form("qianyueriqi"))
if mianmj>99999999 then
mianji=99999999
end if
mianji=mianji
jyprice=trim(request2.Form("jyprice"))
if jyprice>99999999 then
jyprice=99999999
end if
jyprice=jyprice
danwei=trim(request2.Form("danwei"))
meno=trim(request2.Form("meno"))
meno=replace(meno,vbcrlf,"<br>")
sql="select * from house where area='"&area&"' and fangwei='"&fangwei&"' and fclx='"&fclx&"' and cenci='"&cenci&"' and menpaihao='"&menpaihao&"' and xxlb='"&xxlb&"'"
set rs1=conn.execute(sql)
if rs1.eof or rs1.bof then
set rs=server.CreateObject("adodb.recordset")
sql2="select * from house"
rs.open sql,conn,1,3
rs.addnew
rs("lx")=lx
rs("fyh")=fyh
rs("wuyue")=wuyue
rs("fyxz")=fyxz
rs("fwyt")=fwyt
rs("lou")=lou
rs("gyr")=gyr
rs("userid")=userid
rs("xxlb")=xxlb
rs("yxq")=yxq
rs("fangwei")=fangwei
rs("area")=area
rs("zcenci")=zcenci&"层"
rs("cenci")=cenci&"层"
rs("fclx")=fclx
rs("zhbz")=zhbz
rs("zhprice")=zhprice
rs("createyear")=createyear
rs("chaoxiang")=chaoxiang
rs("jiegou")=jiegou
rs("fangwupeizhi")=fangwupeizhi
rs("huzhu")=huzhu
rs("sfz")=sfz
rs("tel")=tel
rs("dijia")=dijia
rs("tengfangri")=tengfangri
rs("weituoxingzhi")=weituoxingzhi
rs("fydengji")=fydengji
rs("yaoshi")=yaoshi
rs("weituoshu")=weituoshu
rs("hetongbeizhu")=hetongbeizhu
rs("lou")=lou
rs("menpaihao")=menpaihao
rs("mianji")=mianji
rs("mianji2")=mianji2
rs("qianyueriqi")=qianyueriqi
rs("qianyueriqi")=qianyueriqi
rs("jyprice")=jyprice
rs("danwei")=danwei
rs("meno")=meno
rs("bimg")=pic
rs.update
set rs=nothing
conn.close
set conn=nothing
set fso=server.createobject("scripting.filesystemobject")
path=Server.MapPath("inc/bianhao.txt")
set txt=fso.opentextfile(path, 1)
if not txt.AtEndOfStream then
line=txt.readall
end if
txt.close
set txt = nothing

line=line+1
set txt2=fso.opentextfile(path, 2)
txt2.write line
txt2.close
set txt2 = nothing
set fso = nothing
response.redirect "hs.asp?xxlb="&xxlb2&""
response.end()
else
response.write "<script>alert('该房源已存在,请不要重复添加!');history.go(-1);</script>"
end if
%>
tuyee 2012-03-04
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 net_lover 的回复:]
binForm.Type = 1
binForm.Mode = 2
试试
[/Quote]

改成2提示:

错误类型:
ADODB.Stream (0x800A0C93)
在此环境中不允许操作。
/inc/UpLoadClass.asp, 第 101 行
Dogfish 2012-03-04
  • 打赏
  • 举报
回复
open成功吗?
孟子E章 2012-03-04
  • 打赏
  • 举报
回复
binForm.Type = 1
binForm.Mode = 2
试试
tuyee 2012-03-04
  • 打赏
  • 举报
回复
有现成的不会换 希望高手帮忙改下这段代码 能用就行了

28,390

社区成员

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

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