Methods used in ACCESS database:
Instr(','+Speciality+',',',',2,')<>0
The complete code is as follows:
The code copy is as follows:
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")&"""target=""_blank""">"&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
If this paragraph is used in SQL, it will prompt that 'Instr' is not a recognizable function name.
SQL Database Update Application:
dbo.IsSpeciality(Speciality,'2')>0
The complete code is as follows:
The code copy is as follows:
'//Download Center - Recommended 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")&"""target=""_blank""">"&Rs("Title")&"</a><br>"&vbCrLf
Rs.MoveNext
Wend
Rs.Close
SetRs=Nothing