TSYS一个新闻多种特性时如何进行前台更新?

2018-09-06 12:19

阅读:449

  ACCESS数据库用的方法:

Instr(,+Speciality+,,,2,)<>0

完整的代码如下:
复制代码 代码如下:FunctionUpdate08()
DimTemplateFilePath
TemplateFilePath=Server.MapPath(../../../default.htm)
DimTClass,strHtml
SetTClass=NewTkl_TemplateClass
strHtml=
DimRs,Sql
Sql=SelectTop8Title,FilePath,AddTimeFromview_NewsInfoWhereInstr(,+Speciality+,,,18,)<>0orderByIdDESC
SetRs=Conn.ExeCute(Sql)
WhileNotRs.Eof
strHtml=strHtml&·[&StrClass.FormatMyDate(Rs(AddTime),{m}/{d})&]<ahref=&Rs(FilePath)&>&Rs(Title)&</a><br>&vbCrLf
Rs.MoveNext
Wend
Rs.Close
SetRs=Nothing

WithTClass
.OpenTemplate(TemplateFilePath)
.StartElement=<!--DownRecommand:start-->
.EndElement=<!--DownRecommand:end-->
.Value=strHtml
.ReplaceTemplate()
.Save()
EndWith
SetTClass=Nothing
EndFunction
如果这段使用在SQL中会提示Instr不是可以识别的函数名。
SQL数据库更新应用:
dbo.IsSpeciality(Speciality,2)>0
完整代码如下:
复制代码 代码如下://下载中心-推荐
FunctionUpdate08()
DimTemplateFilePath
TemplateFilePath=Server.MapPath(../../../default.htm)
DimTClass,strHtml
SetTClass=NewTkl_TemplateClass
strHtml=
DimRs,Sql
Sql=SelectTop8Title,FilePath,AddTimeFromview_NewsInfoWheredbo.IsSpeciality(Speciality,18)>0orderByIdDESC
SetRs=Conn.ExeCute(Sql)
WhileNotRs.Eof
strHtml=strHtml&·[&StrClass.FormatMyDate(Rs(AddTime),{m}/{d})&]<ahref=&Rs(FilePath)&>&Rs(Title)&</a><br>&vbCrLf
Rs.MoveNext
Wend
Rs.Close
SetRs=Nothing

WithTClass
.OpenTemplate(TemplateFilePath)
.StartElement=<!--DownRecommand:start-->
.EndElement=<!--DownRecommand:end-->
.Value=strHtml
.ReplaceTemplate()
.Save()
EndWith
SetTClass=Nothing
EndFunction


评论


亲,登录后才可以留言!