急救ADODB.Recordset 错误 '800a0cc1'

来源:百度知道 编辑:UC知道 时间:2024/05/23 17:09:24
public sub doExecuteInsert(byval strSQL,byval strFields,byval strTree)
dim tmpRS,ii
set tmpRS=Server.CreateObject("ADODB.Recordset")
if instr(strSQL," ")<1 then strSQL="select top 1 * from "&strSQL
doExec tmpRS,strSQL,1,3
'if not tmpRS.eof Then
tmpRS.addnew
if len(strFields)>0 Then
dim tmpAry,aa
tmpAry=split(strFields,",")
for aa=0 to ubound(tmpAry)
'debug tmpAry(aa)&"-"&opsTest.toVariable(strTree.getItem(tmpAry(aa)),"")&"<br>"
tmpRS(tmpAry(aa))=toFormatValue(strTree.getItem(tmpAry(aa)))
next
else
strTree.doBegin()
for ii=1 to strTree.getCount()
'debug strTree.getItemKey()&"<br>"
tmpRS(strTree.getItemKey())=opsCode.toString(strTree.getItemValue())
strTree.doMove()
next
end if
tmpRS.update

出现这种情况是由于你
rs.open打开的这个SQL语句中没有“content”这一列

就是说你的RS记录集取得记录的SQL语句中"select "后面没有“content”这一列,你在619行使用了rs中的"content"列所以导致再现该错误

解决办法:将创建该rs时的SQL语句"select"后的字段列表中添加上content,或者将"select"后面的字段名全去掉,用星号“*”代替来返回所有列。