欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-11-27 13:49:52
access数据库用的方法: instr(','+speciality+',',',2,')<>0 完整的代码如下:复制代码 代码如下:function&nbs...
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