用 流的方式写入和 读出。

解决方案 »

  1.   

    就是不懂写啊,能不能说清楚一点,谢谢了
      

  2.   

    以下是我在上传图片到数据库的代码:
    <%'上传图片
    ingcount=Request.TotalBytes
    posteddata=Request.BinaryRead(ingcount)
    crlf=ChrB(13) & ChrB(10)
    tmpData=LeftB(posteddata,clng(instrb(posteddata,crlf))-1)
    datastart=instrb(posteddata,crlf & crlf)+4
    dataend=instrb(datastart+1,posteddata,tmpdata)-datastart
    stardata=MidB(posteddata,datastart,dataend)if ingcount>200000 then
    Response.Write "<script>alert('请选择小于200K的图片!')</script>"
    Response.Write "<script>history.back()</script>"
    Response.End 
    end ifset conn=server.CreateObject("adodb.connection")
    conn.Open application("connstr")sqlstr="select corp_id,picture from dj_t9 where corp_id="&trim(session("corp_id"))
    set rst=server.CreateObject("adodb.recordset")
    rst.Open sqlstr,conn,1,3,adcmdtable
    if rst.EOF then
    rst.AddNew
    rst("corp_id")=trim(session("corp_id"))
    end if
    rst("picture").appendchunk stardata
    end ifrst.Update
    rst.Close
    conn.Close
    Response.Write "<script>alert('上传成功!');opener.location.reload();self.close()</script>"
    %>