作业帮 > ASP > 教育资讯

ASP技巧:ASP幻灯片新闻代码

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 02:18:53 ASP
ASP技巧:ASP幻灯片新闻代码
ASP技巧:ASP幻灯片新闻代码ASP
【51Test.NET-ASP技巧:ASP幻灯片新闻代码】:

ASP幻灯片新闻代码:




http-equiv="Content-Type" content="text/html; charset=gb2312" />
幻灯片新闻








<%
'幻灯片新闻
Db="../webjx_Data/webjx_Data.Asp"
Set conn = Server.CreateObject("ADODB.Connection")
Connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
Conn.Open Connstr
sql="select top 5 * from [Music_List_Tupian_System] where IswNumsSex='轮换广告' order by IswNumsID desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
k=1
Num_total=rs.recordcount
for i=1 to 5
if i>Num_total then exit for
if i=1 then
imgUrl11="Img/"&rs("IswNumsPhoto")
if len(rs("IswNumsUser"))>=18 then
imgtext11= left(rs("IswNumsUser"),18)&"..."
else
imgtext11=rs("IswNumsUser")
end if
imgLink11=rs("IswNumsClass")
end if
if i=2 then
imgUrl22="Img/"&rs("IswNumsPhoto")
if len(rs("IswNumsUser"))>=18 then
imgtext22= left(rs("IswNumsUser"),18)&"..."
else
imgtext22=rs("IswNumsUser")
end if
imgLink22=rs("IswNumsClass")
end if
if i=3 then
imgUrl33="Img/"&rs("IswNumsPhoto")
if len(rs("IswNumsUser"))>=18 then
imgtext33= left(rs("IswNumsUser"),18)&"..."
else
imgtext33=rs("IswNumsUser")
end if
imgLink33=rs("IswNumsClass")
end if
if i=4 then
imgUrl44="Img/"&rs("IswNumsPhoto")
if len(rs("IswNumsUser"))>=18 then
imgtext44= left(rs("IswNumsUser"),18)&"..."
else
imgtext44=rs("IswNumsUser")
end if
imgLink44=rs("IswNumsClass")
end if
if i=5 then
imgUrl55="Img/"&rs("IswNumsPhoto")
if len(rs("IswNumsUser"))>=18 then
imgtext55= left(rs("IswNumsUser"),18)&"..."
else
imgtext55=rs("IswNumsUser")
end if
imgLink55=rs("IswNumsClass")
end if
rs.movenext
k=k+1
next
else
response.write "暂时没有数据!"
end if
%>
get=_self href="javascript:goUrl()">

ASP