ÀÄÓÃon error resume nextÔì³ÉµÄ¿Õ¼ä±»Í£ÓÃ

·¢²¼Ê±¼ä:2008-11-18 16:35:18   ä¯ÀÀÈËÊý: 312951 ´Î  

on error resume next ÕâÌõÓï¾äÊÇÓÃÀ´ÆÁ±Î³ö´íÐÅÏ¢,µ±³ö´íʱ,ʹµÃ³ÌÐò¼ÌÐøÖ´ÐеÄ,²»¹ýÔÚʹÓÃÖÐ,ËƺõºÜ¶àÈËûÓп¼Âǵ½on error resume nextµÄ×÷Ó÷¶Î§.±ÈÈç

<%

On Error Resume Next

     Set Conn
=Server.CreateObject("ADODB.Connection"
)

    
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("db.mdb"
)

     If
Err.Number<>0 Then Response.Write "Êý¾Ý¿âÁ¬½Ó·¢Éú´íÎó" : Response.
End

    


Set Rs
=conn.execute("Select * from ±í"
)

Do While
Not rs.
eof

     response
.write rs(0
)

rs.
movenext

loop


%>

ÀàËÆÉÏÃæµÄ´úÂë,Èç¹û´íÎóÊÇ·¢ÉúÔÚ½¨Á¢Êý¾ÝÁ¬½ÓµÄʱºò,ÄÇô³ÌÐò»á°´ÕÕÎÒÃÇÉèÏëµÄÄÇÑùÍ£Ö¹Ö´ÐÐ,¸ø³ö³ö´íÐÅÏ¢,µ«¼ÙÈçÊÇÔÚset rs=conn.execute("select * from ±í")ÕâÀï³ö´íÄØ?Õâ¸öʱºòon error resume nextÈÔÈ»ÔÚÆð×÷ÓÃ,Õâʱºò,Ò»¸öÕ¼ÓÃcpu 100%µÄËÀÑ­»·¾Í³öÏÖÁË,½á¹ûÄØ,Èç¹û·þÎñÆ÷ÉèÖõĺÃ,ÄǶ¥¶àÄã×Ô¼ºµÄÕ¾µãÎÞ·¨·ÃÎÊÁË,Èç¹û·þÎñÆ÷ÉèÖò»¹»Ñϸñ,ÄÇÕû¸ö·þÎñÆ÷µÄÕ¾µã¶¼ÒªÔâÑê,½á¹û¾ÍÊÇ¿Õ¼äÉÌÍ£µôÄãµÄ¿Õ¼ä.

´úÂë¸ÄÔìÒ»ÏÂ

<%


Dim conn

Sub connect

On Error Resume Next

     Set Conn
=Server.CreateObject("ADODB.Connection"
)

    
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("db.mdb"
)

     If
Err.Number<>0 Then Response.Write "Êý¾Ý¿âÁ¬½Ó·¢Éú´íÎó" : Response.
End

End sub    


connect


Set Rs
=conn.execute("Select * from ±í"
)

Do While
Not rs.
eof

     response
.write rs(0
)

rs.
movenext

loop


%>

ÕâÑùon error resume next¾ÍÖ»×÷ÓÃÓÚconnectÕâ¸ö¹ý³ÌÁË,ºóÃæ³ÌÐò³ö´í,²»»áÒòΪon error resume next¶ø´øÀ´ËÀÑ­»·.

ÁíÍâ,on error resume next»áÆÁ±Îµô³ö´íÐÅÏ¢,ÔÚд³ÌÐòµÄʱºò,ÓÈÆäÊdzõѧÕßд³ÌÐòµÄʱºò,ºÜÓпÉÄÜÒòΪÕâÌõÓï¾äµÄʹÓÃ,ʹÄãºöÂÔµô³ÌÐòÀïÒþ²ØµÄһЩС´íÎó.ËùÒÔÒ»¶¨ÒªÉ÷ÓÃ.

 
ÓÉÓÚËÀÑ­»·Ôì³É·þÎñÆ÷cpu100%,ÎÒÃǽ«ÔÝÍ£¿Õ¼äweb·þÎñ,´ýÐÞ¸´ÎÊÌâºó²Å¿ÉÖØпªÍ¨



ÉÏһƪ£º¹ØÓÚ SQL Server ûÓÐ dbo ȨÏÞµÄÎÊÌâ
ÏÂһƪ£º¿Õ¼ä²»¹»ÓÃ,ÄÜ·ñÉý¼¶,ÈçºÎÉý¼¶?
±¸°¸ºÅ£º¼½ICP±¸09002658ºÅ
°æȨËùÓÐ ±¾Õ¾³ÌÐò½çÃæ¡¢Ô´´úÂëÊÜÏà¹Ø·¨Âɱ£»¤£¬Î´¾­ÊÚȨ£¬ÑϽûʹÓÃ
Copyright 2008-2016 All rights reserved

ÒÔÏÂjsΪ²âÊÔÐÅÏ¢