调用 BinaryRead 之后,不能使用 Request.Form 集合。 - TOMMYHU - 专注互联网开发及运营技术,提供相关资料及软件下载,奇趣网络时事评论!
Aug 3

调用 BinaryRead 之后,不能使用 Request.Form 集合。 不指定

tommyhu , 17:26 , ASP , Comments(0) , Trackbacks(0) , Reads(10595) , Via Original Large | Medium | Small
firefox是不错的调试工具,嘿嘿!
Quotation

Request 对象 错误 'ASP 0207 : 80004005'

不能使用 Request.Form

/news/adddata-fxs-2009.asp,行 45

调用 BinaryRead 之后,不能使用 Request.Form 集合。


修改为upload.forms后如下正常运行

<%
if request.QueryString("action")="add" then

dim startime,conn,connstr,db,rs_s,rs_s1
startime=timer()
db="../zhibianfz.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr

Dim Upload,successful,tempCls,image,smallImage
'===============================================================================
set Upload=new AnUpLoad    '创建类实例
Upload.SingleSize=200*1024                  '设置单个文件最大上传限制,按字节计;默认为不限制
Upload.MaxSize=200*1024                  '设置最大上传限制,按字节计;默认为不限制
Upload.Exe="rar|jpg|bmp|gif"                  '设置合法扩展名,以|分割,忽略大小写
Upload.GetData()            '获取并保存数据,必须调用本方法
'===============================================================================
if Upload.Err>0 then            '判断错误号,如果myupload.Err<=0表示正常
   response.write Upload.Description       '如果出现错误,获取错误描述
else
    savePath=server.MapPath("fxsphotos")             '图片保存路径
    if upload.Forms("photo")<>"" then
        set tempCls=upload.files("photo")
        if tempcls.SaveToFile(savePath,0) then image=tempCls.FileName
        set tempCls=nothing
    end if


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

news.Open"select * from fxs",conn,1,3
news.AddNew()
news("company")=Upload.forms("company")
news("danganhao")=Upload.forms("danganhao")
news("kehubianhao")=Upload.forms("kehubianhao")
news("tel")=Upload.forms("tel")
news("fax")=Upload.forms("fax")
news("mobile")=Upload.forms("mobile")
news("im")=Upload.forms("im")
news("website")=Upload.forms("website")
news("email")=Upload.forms("email")
news("zhekoulv")=Upload.forms("zhekoulv")
news("yewuyuan")=Upload.forms("yewuyuan")
news("time")=now()
news("address")=Upload.forms("address")
news("contact")=Upload.forms("contact")
news("beizhu")=Upload.forms("beizhu")
news("photo")="fxsphotos/" & image
news.Update()
response.write "<script language=javascript>alert('添加成功!');history.go(-1);</script>"
response.End
conn.close
set news=nothing
end if
end if
set Upload=nothing
%>


▲返回顶部
Last modified by tommyhu on2009/08/03 17:30

Add a comment

Nickname

emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot