为何无法写入数据库?请高手教我!
文件上传没有问题,但是我想把几个变量的值写入数据库,没有成功,不知问题出在哪里,请高手赐教!<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connebwz.asp" -->
<!--#include file="UpLoad_Class.vbs.asp" -->
<%
dim upload
set upload = new AnUpLoad
'upload.Exe = "jpg|bmp|jpeg|gif|png"
'upload.MaxSize = 2 * 1024 * 1024 '2M
upload.GetData()
if upload.ErrorID>0 then
response.Write upload.Description
else
lmxxid_p=upload.forms("select")
filename=upload.forms("text1")
response.Write(lmxxid_p)& "<br />"
response.Write "文件名:" &(filename)& "<br />"
dim file,savpath
savepath = "rj"
set file = upload.files("file1")
if not(file is nothing) then
if file.saveToFile(savepath,1,true) then
rjurl=savepath& "/" & file.LocalName
response.Write(rjurl)& "<br />"
response.Write "文件'" & file.LocalName & "'上传成功,保存位置'" & server.MapPath(savepath & "/" & file.filename) & "',文件大小" & file.size & "字节"
else
response.Write file.Exception
end if
end if
end if
set upload = nothing
%>
<%
Dim rjtj
Dim rjtj_numRows
Set rjtj = Server.CreateObject("ADODB.Recordset")
rjtj.ActiveConnection = MM_connebwz_STRING
rjtj.Source = "SELECT * FROM rjxx ORDER BY rjxxid DESC"
rjtj.CursorType = 0
rjtj.CursorLocation = 2
rjtj.LockType = 3
rjtj.Open()
rjtj.addnew
rjtj.("rjxx_lmmcid")=lmxxid_p
rjtj.("rjname")=file.LocalName
rjtj.("rjlx")=filename
rjtj.("rjurl")=rjurl
rjtj.update
rjtj_numRows = 0
%>
<%
rjtj.Close()
Set rjtj = Nothing
%>