[求助]参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
请教各位.为什么会出现这种错误?实在找不出来了- -因为弄不懂二级菜单,在网上摘了一段代码错误类型
错误类型:
ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
/111/Province.asp, 第 16 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TencentTraveler ; Mozilla/4.0(Compatible Mozilla/4.0EmbeddedWB- 14.59 from: http:// ; Mozilla/4.0(Compatible Mozilla/4.0(Compatible-IESharp)EmbeddedWB- 14.59 from: http:// ; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
网页:
GET /111/Province.asp
时间:
2008年7月29日 星期二, 8:42:57
详细信息:
Microsoft 支持
代码部分:
<script language=JavaScript>
Dim conn, connStr
Set conn = server.CreateObject("ADODB.Connection")
connStr = "Provider = Microsoft.jet.oledb.4.0;"connStr = connStr & "Data Source = " & server.mappath("db/shengfen.mdb")
Conn.Open connStr
<%
dim sql,i,j
'//////////////////////////读出 Province 表//////////////////////////
set rs_Province=server.createobject("adodb.recordset")
sql="select * from Province order by ProvinceOrder"
rs_Province.open sql,conn,1,1
%>
var selects=[];
selects['xxx']=new Array(new Option('请选择城市……','xxx'));
<%
for i=1 to rs_s.recordcount
%>
selects['<%=rs_Province("ProvinceNo")%>']=new Array(
<%
'//////////////////////////读出 City 表//////////////////////////
set rs_City=server.createobject("adodb.recordset")
sql="select * from City where ProvinceID="&rs_Province("id")&" order by ProvinceOrder"
rs_City.open sql,conn,1,1
if rs_City.recordcount>0 then
for j=1 to rs_City.recordcount
if j=rs_City.recordcount then
%>
new Option('<%=trim(rs_City("CityName"))%>','<%=trim(rs_City("CityNo"))%>'));
<%else%>
new Option('<%=trim(rs_City("Cityname"))%>','<%=trim(rs_City("CityNo"))%>'),
<%
end if
rs_City.movenext
next
else
%>
new Option('','0'));
<%
end if
rs_City.close
set rs_City=nothing
rs_Province.movenext
next
rs_Province.close
set rs_Province=nothing
%>
<!--//////////JavaScript控制联动///////////-->
function chsel(){
with (document.form1){
if(province_select.value) {
city_select.options.length=0;
for(var i=0;i<selects[province_select.value].length;i++){
city_select.add(selects[province_select.value][i]);
}
}
}
}
</script>
<!--//////////////////////////Province_select下拉列表//////////////////////////-->
<select name="Province_select" onChange=chsel()>
<option value="xxx" selected>请选择省份……</option>
<%
dim tmpid '定义一个临时变量用来记住省id
tmpid=0
set rs_Province=server.CreateObject("ADODB.recordset")
sql="select * from Province order by ProvinceOrder"
rs_Province.open sql,conn,1,1
while not rs_Province.eof
tmpid=rs_Province("id")
%>
<option value="<%=rs_Province("ProvinceNo")%>" ><%=trim(rs_Province("ProvinceName"))%></option>
<%
rs_Province.movenext
wend
rs_Province.close
set rs_Province=nothing
%>
</select>
<!--//////////////////////////City_select下拉列表//////////////////////////-->
<select name="City_select">
<%
set rs_City=server.createobject("adodb.recordset")
sql="select * from City where ProvinceID="&tmpid&" order by CityOrder"
rs_City.open sql,conn,1,1
while not rs_City.eof
%>
<option value="<%=rs_City("CityNo")%>"><%=trim(rs_City("CityName"))%></option>
<%
rs_City.movenext
wend
rs_City.close
set rs_City=nothing
%>
</select>