主题:错误类型:ADODB.Recordset (0x800A0CC1)
错误类型:ADODB.Recordset (0x800A0CC1)在对应所需名称或序数的集合中,未找到项目。
代码如下:
<%
dim rscity,sqlcity
set rscity=server.createobject("adodb.recordset")
sqlcity = "select * from city2 order by paixu desc"
rscity.open sqlcity,conn,1,1
%><SCRIPT language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rscity.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rscity("city2"))%>","<%= trim(rscity("city1"))%>","<%= trim(rscity("id"))%>");
<%
count = count + 1
rscity.movenext
loop
rscity.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.city2.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.city2.options[document.myform.city2.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</SCRIPT><%
sqlcity = "select * from city1 order by paixu desc"
rscity.open sqlcity,conn,1,1
if rscity.eof and rscity.bof then
response.write "请先添加栏目。"
response.end
else
%><SELECT name="city1" onChange="changelocation(document.myform.city1.options[document.myform.city1.selectedIndex].value)" size="1">
<OPTION selected value=>分类</OPTION>
<%do while not rscity.eof
%><OPTION value="<%=trim(rscity("id"))%>"><%=trim(left(rscity("city1"),chr(32)))%></OPTION>
<%
rscity.movenext
loop
end if
rscity.close
%></SELECT>
<SELECT name="city2">
<OPTION selected value=>二级分类</OPTION>
</SELECT>
问题补充:就是提示这行出错<OPTION value="<%=trim(rscity("id"))%>"><%=trim(left(rscity("city1"),chr(32)))%></OPTION>
我这个是一个下拉菜单来的,字段名应该是没有错,浏览后就出现上面的错误提示。
city1这个表中的大类,city2是表中的小类
请大虾门帮我看看是那里出错!