不使用组件实现多个图片与文本数据同时写入数据库(2)
''---------------------------------------------------------------------------
------------------------------------
<!--#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
%>
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论