脚本错误 缺少对象,显示“缺少对象”错误,不知道怎么回事

显示“缺少对象”错误,不知道怎么回事 - 故障解答 - 电脑教程网

显示“缺少对象”错误,不知道怎么回事

日期:2006-04-22   荐:
显示“缺少对象”错误,不知道怎么回事<!--#include file="conn.asp"--><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>查询统计</title></head><body ><form action="index.asp" method="post" name="form1"><font size="4" face="黑体">组合查询:</font><p>公司:<select size="1" name="D1"><% sql="select distinct coname from copytable order by coname asc" rs.open sql,con,0,1 do while not rs.eof response.write"<option value='"&rs("coname")&"'>"&rs("coname") rs.movenext loop rs.close set rs=nothing con.close set con=nothing %> </select>&nbsp;&nbsp; 选择排序方式:<select size="1" name="test" > <option value="coname">公司</option> <option value="copytime">时间</option> </select> <input type="submit" value="确定"></p></form> <% dim m m=request.form("test") if m="" then sql="select * from copytable order by coname" else sql="select * from copytable order by "&m&" " end if set rs=con.execute(sql) if rs.bof and rs.eof then response.write"很抱歉,没有记录" else %> <table border="1" width="80%" bordercolor="#C0C0C0" bordercolorlight="#000080" cellspacing="0" cellpadding="0" bordercolordark="#E0E0E0"> <tr align=center> <td width="13%">备份编号</td> <td width="20%">备份文件名称</td> <td width="22%">公司名称</td> <td width="31%">时间</td> <td width="13%">是否完成</td> </tr> <% while not rs.eof response.write"<tr align=center>" response.write"<td width=""21%"">"&rs("copyid")&"</td>" response.write"<td width=""25%"">"&rs("copyfilename")&"</td>" response.write"<td width=""20%"">"&rs("coname")&"</td>" response.write"<td width=""15%"">"&rs("copytime")&"</td>" response.write"<td width=""19%"">"&rs("tag")&"</td>" response.write"</tr>" rs.movenext wend end if rs.close set rs=nothing con.close set con=nothing %> </table></body></html>把第一个select标签去掉就没问题了,加上就显示缺少对象,头疼!!rs在什么地方创建的啊?response.write"<option value='"&rs("coname")&"'>"&rs("coname") 后面补上</option>试试
标签: