日期:2013-01-16  浏览次数:21097 次

'filename: add.asp
'---------------------------------------------------------------------------
------------------------------------
<!--#INCLUDE FILE="upload.inc"-->
<%
    if session("IsPass")=1 then
      Dim FormData,FormSize
      FormSize=Request.TotalBytes
      FormData=Request.BinaryRead(FormSize)
      Set Fields = GetUpload(FormData)
      set conn=server.CreateObject("ADODB.Connection")
      conn.Open "driver={SQL
Server};server=ServerIP;uid=Username;pwd=PassWord;database=DataBaseName"
      set rec=server.createobject("ADODB.recordset")
      on error resume next

      rec.Open "SELECT * FROM xl",conn,1,3
      on error resume next
      rec.addnew
      rec("ptype")=Fields("ptype").Value
      rec("pname")=Fields("pname").Value
      rec("pname1")=Fields("pname1").Value
      rec("skill")=1
      if Fields("img1").Value<>"" then
        rec("img1").appendchunk Fields("img1").Value
      end if
      if Fields("img2").Value<>"" then
        rec("img2").appendchunk Fields("img2").Value
      end if
      rec.update

      rec.close
      set rec=nothing
      conn.close
      set conn=nothing
      response.redirect "pinput.asp"
    else
      response.redirect "index.htm"
    end if
%>