欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

錯誤號:3704 錯誤描述:對象關(guān)閉時,不允許操作

  發(fā)布時間:2015-03-06 13:01:59   作者:佚名   我要評論
這篇文章主要介紹了錯誤號:3704 錯誤描述:對象關(guān)閉時,不允許操作,需要的朋友可以參考下

“錯誤號:3704 錯誤描述:對象關(guān)閉時,不允許操作。sql=select top 10 ContentID,a.SortID,a.GroupID,a.Exc.......”
inc/AspCms_MainClass.asp文件,大約900行,原來代碼為:


復(fù)制代碼
代碼如下:

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

我們修改為:


復(fù)制代碼
代碼如下:

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

因為程序在同一個頁面循環(huán){aspcms:content}標簽時,原來的代碼在后面再調(diào)用該標簽時會不斷累加 sperStr值,造成該標簽數(shù)量越多,后面的SQL查詢字段,而Access數(shù)據(jù)庫,單表最多255個字段,SQL查詢里面一次查詢也最多不超過255個字段,當累加的字段數(shù)超過255個時,運行程序就會出錯。此時,會引起inc/AspCms_MainClass.asp文件,大約152行的程序代碼,內(nèi)容是:


復(fù)制代碼
代碼如下:

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)了前文的錯誤 。

相關(guān)文章

最新評論