概述
ACCESS数据库用的方法:
Instr(','+Speciality+',',',2,')<>0
完整的代码如下:
复制代码 代码如下:
Function Update08()
Dim TemplateFilePath
TemplateFilePath=Server.MapPath("../../../default.htm")
Dim TClass,strHtml
Set TClass=New Tkl_TemplateClass
strHtml=""
Dim Rs,Sql
Sql="Select Top 8 Title,FilePath,AddTime From view_NewsInfo Where Instr(','+Speciality+',',',18,')<>0 order By Id DESC"
Set Rs=Conn.ExeCute(Sql)
While Not Rs.Eof
strHtml=strHtml&"·[" & StrClass.FormatMyDate(Rs("AddTime"),"{m}/{d}") & "]<a href=""" & Rs("FilePath") & """ target=""_blank"">" & Rs("Title") & "</a><br>" & vbCrLf
Rs.MoveNext
Wend
Rs.Close
Set Rs=Nothing
With TClass
.OpenTemplate(TemplateFilePath)
.StartElement="<!--DownRecommand:start-->"
.EndElement="<!--DownRecommand:end-->"
.Value=strHtml
.ReplaceTemplate()
.Save()
End With
Set TClass=Nothing
End Function
Dim TemplateFilePath
TemplateFilePath=Server.MapPath("../../../default.htm")
Dim TClass,strHtml
Set TClass=New Tkl_TemplateClass
strHtml=""
Dim Rs,Sql
Sql="Select Top 8 Title,FilePath,AddTime From view_NewsInfo Where Instr(','+Speciality+',',',18,')<>0 order By Id DESC"
Set Rs=Conn.ExeCute(Sql)
While Not Rs.Eof
strHtml=strHtml&"·[" & StrClass.FormatMyDate(Rs("AddTime"),"{m}/{d}") & "]<a href=""" & Rs("FilePath") & """ target=""_blank"">" & Rs("Title") & "</a><br>" & vbCrLf
Rs.MoveNext
Wend
Rs.Close
Set Rs=Nothing
With TClass
.OpenTemplate(TemplateFilePath)
.StartElement="<!--DownRecommand:start-->"
.EndElement="<!--DownRecommand:end-->"
.Value=strHtml
.ReplaceTemplate()
.Save()
End With
Set TClass=Nothing
End Function
如果这段使用在SQL中会提示'Instr' 不是可以识别的 函数名。
SQL数据库更新应用:
dbo.IsSpeciality(Speciality,'2')>0
完整代码如下:
复制代码 代码如下:
'//下载中心 - 推荐
Function Update08()
Dim TemplateFilePath
TemplateFilePath=Server.MapPath("../../../default.htm")
Dim TClass,strHtml
Set TClass=New Tkl_TemplateClass
strHtml=""
Dim Rs,Sql
Sql="Select Top 8 Title,FilePath,AddTime From view_NewsInfo Where dbo.IsSpeciality(Speciality,'18')>0 order By Id DESC"
Set Rs=Conn.ExeCute(Sql)
While Not Rs.Eof
strHtml=strHtml&"·[" & StrClass.FormatMyDate(Rs("AddTime"),"{m}/{d}") & "]<a href=""" & Rs("FilePath") & """ target=""_blank"">" & Rs("Title") & "</a><br>" & vbCrLf
Rs.MoveNext
Wend
Rs.Close
Set Rs=Nothing
With TClass
.OpenTemplate(TemplateFilePath)
.StartElement="<!--DownRecommand:start-->"
.EndElement="<!--DownRecommand:end-->"
.Value=strHtml
.ReplaceTemplate()
.Save()
End With
Set TClass=Nothing
End Function
Function Update08()
Dim TemplateFilePath
TemplateFilePath=Server.MapPath("../../../default.htm")
Dim TClass,strHtml
Set TClass=New Tkl_TemplateClass
strHtml=""
Dim Rs,Sql
Sql="Select Top 8 Title,FilePath,AddTime From view_NewsInfo Where dbo.IsSpeciality(Speciality,'18')>0 order By Id DESC"
Set Rs=Conn.ExeCute(Sql)
While Not Rs.Eof
strHtml=strHtml&"·[" & StrClass.FormatMyDate(Rs("AddTime"),"{m}/{d}") & "]<a href=""" & Rs("FilePath") & """ target=""_blank"">" & Rs("Title") & "</a><br>" & vbCrLf
Rs.MoveNext
Wend
Rs.Close
Set Rs=Nothing
With TClass
.OpenTemplate(TemplateFilePath)
.StartElement="<!--DownRecommand:start-->"
.EndElement="<!--DownRecommand:end-->"
.Value=strHtml
.ReplaceTemplate()
.Save()
End With
Set TClass=Nothing
End Function
最后
以上就是勤奋期待为你收集整理的TSYS一个新闻多种特性时如何进行前台更新?的全部内容,希望文章能够帮你解决TSYS一个新闻多种特性时如何进行前台更新?所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复