一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

php+js实现新浪滑门效果代码

时间:2008-02-28 编辑:简简单单 来源:一聚教程网

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">


无标题文档

<%
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

%>



 

 

 


 


热门栏目