当前位置: 移动技术网 > IT编程>开发语言>Asp > TSYS一个新闻多种特性时如何进行前台更新?

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

2017年12月12日  | 移动技术网IT编程  | 我要评论
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 

如果这段使用在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 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网