最近对公司的网站进行改版,由于产品比较多,有些产品可能属于不同的多个产品分类,在前端调用显示所有产品时,通过分类TAG分类的产品无法显示,生成静态也时直接报如下错误:
错误号:3704
错误描述:对象关闭时,不允许操作。sql=select top 10 ContentID,a.SortID,a.GroupID,a.Exclusive,Title,Title2,TitleColor,IsOutLink,OutLink,Author,ContentSource,ContentTag,Content,ContentStatus,IsTop,Isrecommend,IsImageNews,IsHeadline,IsFeatured,ContentOrder,IsGenerated,Visits,a.AddTime,a.ImagePath,a.IndexImage,a.DownURL,a.PageFileName,a.PageDesc,SortType,SortURL,SortFolder,SortFileName,SortName,ContentFolder,ContentFileName,b.GroupID,b.IcoImage,b.Exclusive,P_demo,P_kucun from AspCms_Content as a,AspCms_Sort as b where a.LanguageID=1 and a.SortID=b.SortID and ContentStatus=1 and TimeStatus=0 and a.Star=1 and order by IsTop desc,isrecommend desc,ContentOrder,a.AddTime desc
通过两天的调试,和网上的搜索终于找到解决方法。
先在AspCms_MainClass.asp文件中找到
aboutkey=replace(getTagID(aboutkey),"}{","%' or ContentTag like '%")
大概在906行左右
将上面这句替换成
aboutkey=replace(aboutkey,"}{","%' or ContentTag like '%")
在生成静态页,一切正常。问题解决