第一个数据库!
<%
dbpath="#5hen88data/#8188wuhen.asp" '数据库路径
connstr="Provider=Microsoft.Jet.OLEDB.4.0;data source="&server.mappath(dbpath)
set conn=server.createobject("adodb.connection")
conn.open connstr
<%
FLASH 是第一个数据库里的表!,这是查第一个数据库!
dim yyphrs,yyphsql
yyphsql="select top 10 * from flash where bigclassid=1 order by hits desc"
set yyphrs=conn.execute(yyphsql)
do while not yyphrs.eof
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="10%"><img src="images/top4.gif" width="8" height="8"></td>
<td width="90%"><a href="flash_play.asp?id=<%=yyphrs("id") %>"><%=yyphrs("flashname")%></a></td>
</tr>
</table>
<% yyphrs.movenext
loop
yyphrs.close
set yyphrs=nothing
%>
第二个数库库!
<%
dim bbsrs,bbssql
path="bbs/database/yuan520.mdb" '数据库路径
conn="Provider=Microsoft.Jet.OLEDB.4.0;data source="&server.mappath(path)
set db=server.createobject("adodb.connection")
db.open conn
%>
<%dim yyphrs,yyphsql
yyphsql="select top 10 * from flash where bigclassid=1 order by hits desc"
set yyphrs=conn.execute(yyphsql)
do while not yyphrs.eof
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="10%"><img src="images/top4.gif" width="8" height="8"></td>
<td width="90%"><a href="flash_play.asp?id=<%=yyphrs("id") %>"><%=yyphrs("flashname")%></a></td>
</tr>
</table>
<% yyphrs.movenext
loop
yyphrs.close
set yyphrs=nothing
%>
<%
FORUM 是第二个数据库里的表!
bbssql="select top 10 * from forum where deltopic<>1 and posttime>"&SqlNowString&"-7 order by id Desc"
set bbsrs=conn.execute(bbssql)
do while not bbsrs.eof
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="10%"><img src="images/top1.gif" width="8" height="8"></td>
<td width="90%"><a href="MTV_play.asp?id=<%=bbsrs("id") %>"><%=bbsrs("topic")%></a></td>
</tr>
</table>
<% bbsrs.movenext
loop
bbsrs.close
set bbsrs=nothing
%>
[此贴子已经被作者于2005-12-21 22:01:59编辑过]