“錯誤號:3704 錯誤描述:對象關(guān)閉時(shí),不允許操作。sql=select top 10 ContentID,a.SortID,a.GroupID,a.Exc.......”
inc/AspCms_MainClass.asp文件,大約900行,原來代碼為:
代碼如下:
if str="content" or str="news" or str="product" or str="down" or str="pic" then
sperStrs =conn.Exec("select SpecCategory+'_'+SpecField from {prefix}SpecSet Order by SpecOrder Asc,SpecID", "arr")
if isarray(sperStrs) then
for each spec in sperStrs
sperStr = sperStr&","&spec
next
end if
我們修改為:
代碼如下:
if str="content" or str="news" or str="product" or str="down" or str="pic" then
sperStrs =conn.Exec("select SpecCategory+'_'+SpecField from {prefix}SpecSet Order by SpecOrder Asc,SpecID", "arr")
if isarray(sperStrs) then
sperStr=""
for each spec in sperStrs
sperStr = sperStr&","&spec
next
end if
因?yàn)槌绦蛟谕粋€頁面循環(huán){aspcms:content}標(biāo)簽時(shí),原來的代碼在后面再調(diào)用該標(biāo)簽時(shí)會不斷累加 sperStr值,造成該標(biāo)簽數(shù)量越多,后面的SQL查詢字段,而Access數(shù)據(jù)庫,單表最多255個字段,SQL查詢里面一次查詢也最多不超過255個字段,當(dāng)累加的字段數(shù)超過255個時(shí),運(yùn)行程序就會出錯。此時(shí),會引起inc/AspCms_MainClass.asp文件,大約152行的程序代碼,內(nèi)容是:
代碼如下:
If Not DebugMode Then
if Err then
errid=Err.number:errdes=Err.description:Err.Clear:dbConn.close:set dbConn=nothing:isConnect=false
echoErr err_03,errid,errdes&"sql="&sqlStr
end if
end if
如果有錯誤,程序代碼會關(guān)閉數(shù)據(jù)。于是就出現(xiàn)了前文的錯誤 。
更多信息請查看IT技術(shù)專欄