<%
db="../data/fy2sc.mdb"			'这里修改数据库路径或名称
Set conn = Server.CreateObject("ADODB.Connection")
dbpath="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open dbpath

dim rs,imgNum,mesNum

mesNum=5			'图片显示张数

set rs=server.CreateObject("adodb.recordset")
rs.open "select top "& mesNum &" * from article where imgname <> '' order by articleid desc",conn,1,1
if rs.eof then
	response.write "暂无信息"
	response.End()
end if

imgNum=rs.recordcount
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style type="text/css">
td {font-size: 12px;color:#FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<script type="text/javascript">
<%
for i=1 to imgNum
	response.write "imgUrl"&i&"='../"&rs("imgname")&"';"
	response.write "imgtext"&i&"='"&rs("title")&"';"
	response.write "imgLink"&i&"=escape('../viewNews.asp?id="&rs("articleid")&"');"
	rs.movenext
next
%>

 var focus_width=190
 var focus_height=140
 var text_height=18
 var swf_height = focus_height+text_height

<%
dim d,i
 for i=1 to imgNum
 	d=d&"imgUrl"&i&"+'|'+"
 next
 response.write "var pics="&left(d,len(d)-5)&";"
 d=""
 
  for i=1 to imgNum
 	d=d&"imgLink"&i&"+'|'+"
 next
 response.write "var links="&left(d,len(d)-5)&";"
 d=""
 
  for i=1 to imgNum
 	d=d&"imgtext"&i&"+'|'+"
 next
 response.write "var texts="&left(d,len(d)-5)&";"
 d=""
%>

 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus1.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('</object>');
 </script>
 </td>
  </tr>
</table>
</body>
</html>