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
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!