这样提示错误:
技术信息(用于支持人员)
错误类型:
ADODB.Recordset (0x800A0E7D)
连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
/conn2.asp, 第 2 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)
网页:
GET /222222jl.asp
<%set conn=server.createobject("ADODB.RecordSet")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("nianji.mdb")
%>
<%
set km=Server.CreateObject("ADODB.RecordSet") '矿名,相当于你要的省份名
km.open "select distinct km from dwdzb order by km"
conn,1,1
set dm=Server.CreateObject("ADODB.RecordSet") '队名,相当于你要的城市名
dm.open "select * from dwdzb order by dm"
conn,1,1
%>
<script language="javascript">
dm=new Array();
var count;
count=0;
<%
c=0
if not (dm.eof and dm.bof) then
dm.movefirst
end if
do while not dm.eof
%>
dm[<%=c%>]=new Array("<%=trim(dm("km"))%>","<%=trim(dm("dm"))%>","<%=trim(dm("dwdm"))%>");
<%
c=c+1
dm.movenext
loop
%>
count=<%=c%>;
function checkdm(km)
{
var i,j;
j=1;
if(km=="管理员")
{
document.f1.dm.length=1;
document.f1.dm.options[0]=new Option("","");
}
if(km=="全部")
{
document.f1.dm.length=1;
document.f1.dm.options[0]=new Option("全部","全部");
}
for(i=0;i<count;i++)
{
if(dm[i][0]==km)
{
document.f1.dm.length=j+1;
document.f1.dm.options[j]=new Option(dm[i][1],dm[i][1]);
j=j+1;
}
}
}
</script>
<table align=center border=1 cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#000000">
<form name="f1" method="post" action="login_check.asp">
<tr height=30>
<td width=80> 矿名:</td>
<td width=120>
<%km.movefirst%>
<select name="km" size="1" onChange="checkdm(document.f1.km.value)"> '重点在这里,onchange事件
<option value="管理员">管理员</option>
<%do while not km.eof%>
<option value=<%=km("km")%>><%=km("km")%></option>
<%km.movenext
loop%>
</select>
</td>
</tr>
<tr height=30>
<td> 队名:</td>
<td>
<select name="dm" size="1">
<option> </option>
</select>
</td>
</tr>
<tr height=30>
<td> 密码:</td>
<td><input type="password" name="psw" size=10></td>
</tr>
<tr align=center height=30>