ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/admin1/picnews/a_addpicok.asp,行 88
代码如下
<!--#include FILE="clsUp.asp"-->
<%
sql0="DBQ="+server.mappath("../../1/db2.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
set conn0=server.createobject("ADODB.CONNECTION")
conn0.open sql0
dim upfile,formPath,ServerPath,FSPath,formName,FileName,oFile,upfilecount,GetFilePath,file1,id,rst,sqlt,rec,dd,strsql,connstr,conn
upfilecount=0
set upfile=new clsUp
upfile.NoAllowExt="asp;exe;htm;html;aspx;cs;vb;js;"
upfile.GetData (10240000)
for each formName in upfile.file
set oFile=upfile.file(formname)
if upfile.form("title")="" then
Response.Write "<script language=javascript>alert('没有标题');history.back(-1);</script>"
response.end
end if
if oFile.filesize=0 then
Response.Write "<script language=javascript>alert('没有缩位图');history.back(-1);</script>"
response.end
end if
FileName=month(now)&day(now)&hour(now)&minute(now)&second(now)&oFile.filename
FSPath=Server.mappath("pic/")
upfile.SaveToFile formname,FSPath&"\"&FileName
response.write FSPath&"\"&FileName
if upfile.isErr then
select case upfile.isErr
case 1
Response.Write "<script language=javascript>alert('"&upfile.errmessage&"');history.back(-1);</script>"
response.end
case 2
Response.Write "<script language=javascript>alert('"&upfile.errmessage&"');history.back(-1);</script>"
response.end
case 3
Response.Write "<script language=javascript>alert('"&upfile.errmessage&"');history.back(-1);</script>"
response.end
end select
else
connstr = "Driver={SQL Server};server=(local);uid=baby;pwd=qingdao!##)^#(@)(^baby;database=baby;"
set conn = Server.Createobject("ADODB.Connection")
conn.open connstr
id=session("id")
set rst=server.createobject("adodb.recordset")
sqlt="select * from qyml where id='"&session("id")&"'"
rst.open sqlt,conn,1,3
set rec=server.createobject("ADODB.recordset")
rec.Open "SELECt * FROM picnews",conn,1,3
rec.addnew
rec("class")=upfile.form("class")
rec("fl")=upfile.form("fl")
rec("content")=upfile.form("content")
rec("title")=upfile.form("title")
rec("id")=session("id")
rec("kidname")=rst("qymc")
rec("qu")=rst("sf")
rec("dat")=now()
rec("flag")=0
rec("pic")=FileName
rec("filePathName")="../htmlp/"&month(now)&day(now)&hour(now)&minute(now)&second(now)&year(now)&".html"
rec.update
dim nn
dd="select count(kidid) from picnews where id="&session("id")
set nn=conn.execute(dd)
nn=nn(0)
strSQL="update qyml set uflag="&nn&"where [id]="&session("id")
conn.Execute strSQL
set nn=nothing
set ofile=nothing
end if
next
set rs1=server.CreateObject("ADODB.RecordSet")
rs1.open "select top 1 * from picnews order by kidid desc",conn,1,1(这个就是88行)
if rs1("class")="0" then
zfrom="幼儿园"
else
zfrom=rs1("class")
end if
set rsModel=server.createObject("Adodb.RecordSet")
sqlModel="select * from news_Model where id=231"
rsModel.open sqlModel,conn0,1,1
page_Model=rsModel("ModelContent")
page_Model = Replace(page_Model, "$#$###TopTitle###$#$", upfile.form("title")&" | 青岛学前教育网 | 青岛幼教网")
page_Model = Replace(page_Model, "$#$###Title###$#$", upfile.form("title"))
page_Model = Replace(page_Model, "$#$###type###$#$", rst("qymc"))
page_Model = Replace(page_Model, "$#$###DateTime###$#$",now())
page_Model = Replace(page_Model, "$#$###laiyuan###$#$",rst("qymc"))
page_Model = Replace(page_Model, "$#$###web###$#$",rst("web"))
page_Model = Replace(page_Model, "$#$###zfrom###$#$",zfrom)
page_Model = Replace(page_Model, "$#$###Content###$#$",upfile.form("content"))
page_Model = Replace(page_Model, "$#$###id###$#$",rs1("kidid"))
Set fs = Server.CreateObject("Scripting.FileSystemObject")
fpn=rs1("filePathName")
Filepn = Server.MapPath("../"&fpn)
Set txt = fs.OpenTextFile(Filepn, 2, True) '打开为只写文件
Data=page_Model
txt.write Data
txt.close
set txt=nothing
set fs=nothing
if rsModel.state<>0 then rsModel.close
set rsModel=nothing
conn.close
set conn=nothing
if err.number=0 then
%>
<script language="vbscript" >
msgbox "静态页成功生成!",64
</script>
<%
else
response.Write err.description
%>
<script language="vbscript" >
msgbox "数据入库过程中出现意外,操作失败。",64
</script>
<%
end if
response.redirect "p_list.asp"
%>