| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 820 人关注过本帖
标题:[求助]不知道为什么出现这种情况,
只看楼主 加入收藏
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
结帖率:77.27%
收藏
 问题点数:0 回复次数:12 
[求助]不知道为什么出现这种情况,

<table width="180" border="0" cellspacing="0" cellpadding="0" background="img/didi.jpg"> <tr> <td><img src="img/soho_r1_c1.jpg"></td> </tr> <tr> <TD> <% dim count set rs=server.createobject("adodb.recordset") rs.open "select * from sorts order by sortsorder ",conn,1,1%> <script language = "JavaScript"> var onecount; onecount=0; subcat = new Array(); <% count = 0 do while not rs.eof %> subcat[<%=count%>] = new Array("<%= trim(rs("sorts"))%>","<%= rs("categoryid")%>","<%= rs("sortsid")%>"); <% count = count + 1 rs.movenext loop rs.close %> onecount=<%=count%>;

function changelocation(locationid) { document.myform.sortsid.length = 0;

var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.myform.sortsid.options[document.myform.sortsid.length] = new Option(subcat[i][0], subcat[i][2]); } } }

</script> <form name="myform" method="post" action="saveaddpro.asp?action=add"> <table width="170" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>

<% rs.open "select * from category order by categoryorder",conn,1,1 if rs.eof and rs.bof then response.write "没有内容!" response.end else %> <div align="center"> <select name="categoryid" size="1" id="categoryid" onChange="changelocation(document.myform.categoryid.options[document.myform.categoryid.selectedIndex].value)"> <option selected value="<%=rs("categoryid")%>"><%=trim(rs("category"))%></option> <%

selclass=rs("categoryid") rs.movenext do while not rs.eof %> <option value="<%=rs("categoryid")%>"><%=trim(rs("category"))%></option> <% rs.movenext loop end if rs.close %> </select></div> <Br> <div align="center"><select name="sortsid"> <% rs.open "select * from sorts where categoryid="&selclass ,conn,1,1 if not(rs.eof and rs.bof) then %> <option selected value="<%=rs("sortsid")%>"><%=rs("sorts")%></option> <% rs.movenext do while not rs.eof %> <option value="<%=rs("sortsid")%>"><%=rs("sorts")%></option> <% rs.movenext loop end if rs.close rs.open "select * from TimesProList",conn,1,1 %> </select> </div> </td> </tr> <tr> <td height="50"> <div align="center"> <input name="key" type="text" size="12"> <input type="submit" name="Submit" value="提交" onClick="return checkpro();"> </div></td> <% rs.close set rs = nothing conn.Close set conn = nothing %> </tr> </table> </form></TD> </tr> <tr> <td><img src="img/kou.jpg" width="171" height="13"></td> </tr> </table> 这段代码,单独执行可以,但是放到网页就和别的调用数据库的代码冲突,出现好像死循环的现象不知道为什么?

搜索更多相关主题的帖子: background border count 
2005-08-29 09:47
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
rs.close rs.open "select * from TimesProList",conn,1,1我看除了这句话没用以外 看不出什么地方能死循环 %>
2005-08-29 09:58
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 
有用,

面朝大海,春暖花开!
2005-08-29 10:14
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 
它单独执行时没事,可是放到一起就不行了,,我把全部的代码给你们贴出来,

面朝大海,春暖花开!
2005-08-29 10:15
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 

<style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; }

.style1 { color: #000000; font-size: 12px; } --> </style> <table width="180" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="170"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="img/pinpai.jpg"></td> </tr><tr> <td width="180" align="center" background="img/didi.jpg"> <table width="180" border="0" cellspacing="0" cellpadding="0" background="img/didi.jpg"> <tr> <td><img src="img/soho_r1_c1.jpg"></td> </tr> <tr> <TD> <% dim count set rs=server.createobject("adodb.recordset") rs.open "select * from sorts order by sortsorder ",conn,1,1%> <script language = "JavaScript"> var onecount; onecount=0; subcat = new Array(); <% count = 0 do while not rs.eof %> subcat[<%=count%>] = new Array("<%= trim(rs("sorts"))%>","<%= rs("categoryid")%>","<%= rs("sortsid")%>"); <% count = count + 1 rs.movenext loop rs.close %> onecount=<%=count%>;

function changelocation(locationid) { document.myform.sortsid.length = 0;

var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.myform.sortsid.options[document.myform.sortsid.length] = new Option(subcat[i][0], subcat[i][2]); } } }

</script> <form name="myform" method="post" action="saveaddpro.asp?action=add"> <table width="170" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>

<% rs.open "select * from category order by categoryorder",conn,1,1 if rs.eof and rs.bof then response.write "没有内容!" response.end else %> <div align="center"> <select name="categoryid" size="1" id="categoryid" onChange="changelocation(document.myform.categoryid.options[document.myform.categoryid.selectedIndex].value)"> <option selected value="<%=rs("categoryid")%>"><%=trim(rs("category"))%></option> <%

selclass=rs("categoryid") rs.movenext do while not rs.eof %> <option value="<%=rs("categoryid")%>"><%=trim(rs("category"))%></option> <% rs.movenext loop end if rs.close %> </select></div> <Br> <div align="center"><select name="sortsid"> <% rs.open "select * from sorts where categoryid="&selclass ,conn,1,1 if not(rs.eof and rs.bof) then %> <option selected value="<%=rs("sortsid")%>"><%=rs("sorts")%></option> <% rs.movenext do while not rs.eof %> <option value="<%=rs("sortsid")%>"><%=rs("sorts")%></option> <% rs.movenext loop end if rs.close rs.open "select * from TimesProList",conn,1,1 %> </select> </div> </td> </tr> <tr> <td height="50"> <div align="center"> <input name="key" type="text" size="12"> <input type="submit" name="Submit" value="提交" onClick="return checkpro();"> </div></td> <% rs.close set rs = nothing conn.Close set conn = nothing %> </tr> </table> </form></TD> </tr> <tr> <td><img src="img/kou.jpg" width="171" height="13"></td> </tr> </table>

</td> </tr> <tr> <td width="180" ><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="180" background="img/dd.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="img/lxwm_r1_c1.jpg" width="180" height="45"></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="img/lxwm_r2_c1_r1_c1.jpg" width="180" height="19"></td> </tr> <tr> <td style="color:6A6A6A; font-size:12px; line-height:20px;"><img src="img/lxwm_r2_c1_r2_c1.jpg" width="180" height="89"></td> </tr> <tr> <td><img src="img/lxwm_r2_c1_r3_c1.jpg" width="180" height="33"></td> </tr> <tr> <td width="180" background="img/dd.jpg" align="center"><table width="80%" border="0" cellspacing="0" cellpadding="0"> <tr> <td style="font-size:12px; line-height:20px;color:6A6A6A; ">&#30005;&nbsp; &#35805;:(86)573-8221761</td> </tr> <tr> <td style="font-size:12px; line-height:20px;color:6A6A6A; ">&#20256; &nbsp;&#30495;:(86)573-8413762</td> </tr> <tr> <td style="font-size:12px; line-height:20px;color:6A6A6A; letter-spacing:0px;"><img src="img/email.jpg" width="153" height="13"></td> </tr> <tr> <td style="font-size:12px; line-height:20px;color:6A6A6A; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selfur@163.com</td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td background="img/dd.jpg"><img src="img/ruyu.jpg" width="180" height="47"></td> </tr> <tr> <Td background="img/dd.jpg" align="center" valign="middle"><table width="90%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="top"><!--#include file="ruyu.asp"--></td> </tr> </table> </Td> </tr> </table></td> </tr> <tr> <td background="img/leftdi.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="180" valign="bottom"> </td> </tr> <tr> <td><script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <table width="101" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="101" height="22">

<%

TimesDB="admin/#TimesShop.asp" connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&TimesDB&"") On Error Resume Next Set conn = Server.CreateObject("ADODB.Connection") conn.open connstr If Err Then err.Clear Set Conn = Nothing Response.Write "数据库连接出错,请检查连接字串。"'注释,需要把这几个字翻译成英文。 Response.End End If set rec=server.createobject("adodb.recordset") rec.open "select * from links order by linkorder",conn,1,1 if rec.eof then response.write "没有东西!"

else %><select name="menu1" onChange="MM_jumpMenu('parent',this,0)" class=style1> <option value="">文字友情链结</option> <option value="<%=rec("linkurl")%>"><%=trim(rec("linkname"))%></option> <% dim selclass selclass=rec("linkurl") rec.movenext do while not rec.eof %> <option value="<%=rec("linkurl")%>"><%=trim(rec("linkname"))%></option> <% rec.movenext loop end if rec.close %> </select></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table> 这样就可以了,可是我不想这么写,,


面朝大海,春暖花开!
2005-08-29 10:16
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 

<!--#include file="cnnn.asp"--> <% set rs=server.CreateObject("adodb.recordset") sql="select top 12 * from chanpin order by id desc" rs.open sql,conn,1 %> <% set rs1=server.CreateObject("adodb.recordset") sql="select username from member order by id desc" rs1.open sql,conn,1%> <% set rs2=server.CreateObject("adodb.recordset") sql="select top 5 id,subject from member order by id desc" rs2.open sql,conn,1 %> <% set gong=server.CreateObject("adodb.recordset") sql="select count(mode) from member where mode= '供' " gong.open sql,conn,1 %> <% set qiu=server.CreateObject("adodb.recordset") sql="select count(mode) from member where mode= '求' " qiu.open sql,conn,1 %> <% set hezuo=server.CreateObject("adodb.recordset") sql="select count(mode) from member where mode= '合作' " hezuo.open sql,conn,1 %> <% set daili=server.CreateObject("adodb.recordset") sql="select count(mode) from member where mode= '代理' " daili.open sql,conn,1 %> <% set kucun=server.CreateObject("adodb.recordset") sql="select count(mode) from member where mode= '库存' " kucun.open sql,conn,1 %> <% set huiyuan=server.CreateObject("adodb.recordset") sql="select count(username) from member where username <> ''" huiyuan.open sql,conn,1 %> <% SET Rss = Server.CreateObject("ADODB.Recordset") sql2 = "select count(sess) from online" set rsonline = conns.Execute (sql2) online = rsonline(0) %> <% set taday=server.createobject("adodb.recordset") sql="select today from counters" set dday=conns.execute(sql) today=dday(0) %> <% sql="select yesterday from counters" set yy=conns.execute(sql) yesterday=yy(0) %> <% sql="select total from counters" set tt=conns.execute(sql) total=tt(0) %> 我原来这样写也可以,我包含了一个conn.asp 连接库,每次set rs1=server.CreateObject("adodb.recordset")然后调用就可以,把红色部分改个名就可以用,可是现在就不行了,必须每次还可建一个<%

TimesDB="admin/#TimesShop.asp" connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&TimesDB&"") On Error Resume Next Set conn = Server.CreateObject("ADODB.Connection") conn.open connstr If Err Then err.Clear Set Conn = Nothing Response.Write "数据库连接出错,请检查连接字串。"'注释,需要把这几个字翻译成英文。 Response.End End If %>才可以实现,,不知道为什么,不写就死循环...


面朝大海,春暖花开!
2005-08-29 10:20
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
你的conn.asp里面是不是有on error resume next
2005-08-29 10:29
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 

<%

TimesDB="admin/#TimesShop.asp" connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&TimesDB&"") On Error Resume Next Set conn = Server.CreateObject("ADODB.Connection") conn.open connstr If Err Then err.Clear Set Conn = Nothing Response.Write "数据库连接出错,请检查连接字串。"'注释,需要把这几个字翻译成英文。 Response.End End If %>这个是我的conn.asp的内容..


面朝大海,春暖花开!
2005-08-29 10:35
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 
你真强,怎么改呀,

面朝大海,春暖花开!
2005-08-29 10:36
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
先把on error resume next注释掉 这样就可以看到出错信息了

其实是你的程序有错误 因为on error resume next 所以程序将错就错 导致多出出错 IIS忙得要命 假如你多等一会儿也会看到错误结果的
2005-08-29 10:55
快速回复:[求助]不知道为什么出现这种情况,
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.071587 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved