asp提取下拉列表框的值作为连接不同数据库的条件
<%tj=request("sel1")
if len(trim(tj))=4 then
%>
<%
Conn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("zhanghao.mdb")
set rs=server.createobject("adodb.recordset")
sql="select * from yuangong"
rs.open sql,conn,1,1
if rs.EOF or rs.BOF then
Response.Write "<hr>数据库中没有记录"
else
do while not rs.EOF
%>
<table border=1 align=center bordercolor=#0099cc cellspacing=0 cellpadding=4>
<tr>
<td width=220 align=center>序号</td>
<td align=center width=40><font face="Arial, Helvetica, sans-serif"><%=rs("序号id")%></font></td>
<td width=260><font face="Arial, Helvetica, sans-serif">口令:<%=rs("用户口令")%></font></td>
<tr><td colspan=2><font face="Arial, Helvetica, sans-serif">姓名:<%=rs("用户姓名")%></font></td>
<td><font face="Arial, Helvetica, sans-serif">密码:<%=rs("用户密码")%></font></td>
<tr><td colspan=2><font face="Arial, Helvetica, sans-serif">职务:<%=rs("职务")%></font></td>
<td><font face="Arial, Helvetica, sans-serif">电话:<%=rs("备注")%></font></td>
</tr></table>
<%
rs.movenext
loop
end if
set rs=nothing
%>
<%
if len(trim(tj))=2 then
Conn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("zhanghao.mdb")
set rs=server.createobject("adodb.recordset")
sql="select * from lingdao"
rs.open sql,conn,1,1
if rs.EOF or rs.BOF then
Response.Write "<hr>数据库中没有记录"
else
do while not rs.EOF
%>
<table border=1 align=center bordercolor=#0099cc cellspacing=0 cellpadding=4>
<tr>
<td width=220 align=center>序号</td>
<td align=center width=40><font face="Arial, Helvetica, sans-serif"><%=rs("序号id")%></font></td>
<td width=260><font face="Arial, Helvetica, sans-serif">口令:<%=rs("用户口令")%></font></td>
<tr><td colspan=2><font face="Arial, Helvetica, sans-serif">姓名:<%=rs("用户姓名")%></font></td>
<td><font face="Arial, Helvetica, sans-serif">密码:<%=rs("用户密码")%></font></td>
<tr><td colspan=2><font face="Arial, Helvetica, sans-serif">职务:<%=rs("职务")%></font></td>
<td><font face="Arial, Helvetica, sans-serif">电话:<%=rs("备注")%></font></td>
</tr></table>
<%
rs.movenext
loop
end if
set rs=nothing
end if
%>