asp读取两个数据库
程序代码:
<% sql="select * from t_tx order by id desc" set rs_fay=server.CreateObject("adodb.recordset") rs_fay.Open sql,conn,1,1 if not (rs_fay.eof and rs_fay.bof) then Do While Not rs_fay.EOF sql8="select * form t_tx1 where b_num="&rs_fay("b_num")&"order by id desc" set rs8=server.CreateObject("adodb.recordset") rs8.open sql8,conn,1,1 response.Write ("<a href=barg_show.asp?ID="&rs8("id")&" target=_blank />"&rs_fay("b_num")&""&rs_fay("b_txt")&"已到期<br><a>") rs_fay.movenext rs8.Close Set rs8 = Nothing loop % end if rs_fay.Close Set rs_fay = Nothing %>首先读取数据库表t_tx里面的内容,循环输出,在读取表t_tx1里面的内容条件是是表t_tx里面的b_num和表t_tx1里面的b_num字段内容相同的内容,
是不是代码写错了,运行结果,
输出没有内容,
是否有更好的代码可以替换