<% function InterceptString(txt,length)'根据中英文字符不同来截取字符 txt=trim(txt) x = len(txt) y = 0 if x >= 1 then for ii = 1 to x if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then '如果是汉字 y = y + 2 else y = y + 1 end if if y >= length then txt = left(trim(txt),ii) '字符串限长 exit for end if next InterceptString = txt else InterceptString = "" end if End Function dim conn,rs1,type1,MM_conn_STRING,rs2,type2,SQL1,SQL2,SQL3,SQL4,SQL5,rs3,rs4,rs5,type3,type4,t ype5 MM_conn_STRING = "Driver={SQL Server};database=sanxt;server=localhost;uid=sanxt;pwd=sanxt;" Set conn = Server.Createobject("ADODB.Connection") conn.open MM_conn_STRING Set rs1=Server.CreateObject("ADODB.recordset") type1="艺术资讯" SQL1="Select top 7 id,caption,content,puttime FROM ccnews where classid='"&Trim(type1)&"' order by id desc" rs1.open SQL1,conn,1,3 %>
网站备案编号:京ICP备00000001号 关于我们 | 联系方式 | 友情连接 | 留言反馈 | 公告列表 | 人才招募
Powered By WRMPS v6.1.0 © 2004-2009 Wangren Inc.
Copyright © 2004-2009 WangRen.Net Inc. All rights reserved.
小说阅读网
Published at 2010-9-4 4:45:17, Powered By WRMPS v6.1.0(ACCESS)