新手使用 ASP 上传代码,出现了问题,请帮忙
照片可以上传至服务器,并且显示responsewrite,但是数据添加不进数据库<!--#include file="UpLoad_Class.asp"-->
<%
dim upload
set upload = new AnUpLoad
upload.Exe = "*"upload.
MaxSize = 10 * 1024 * 1024
upload.GetData()
if upload.ErrorID>0 then
response.Write
upload.Description
else
response.Write "你的名字:" & upload.forms("Mingzi") & "<br />"
response.Write "所在部门:" & upload.forms("Bumen") & "<br />"
dim file,savepath
savepath = "upload"
set file = upload.files("file1")
if file.isfile then
result = file.saveToFile(savepath,0,true)
if result then
response.Write "文件'" & file.LocalName & "'上传成功,保存位置'" & server.MapPath(savepath & "/" & file.filename) & "',文件大小" & file.size & "字节"
else
response.Write file.Exception
dim conn,rsset conn=Server.CreateObject("ADODB.Connection")
conn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("infodata.mdb")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from infodata",conn,1,3
rs.addnewrs("Mingzi")=Mingzi
rs("Bumen")=Bumen
rs("Zhaopian")=file.filename
rs.update
rs.closeset
rs=nothing
conn.Close
set conn=nothing
end if
end if
end if
set upload = nothing
%>