|
我使用貴工作室的"挑戰dreamweaver for asp互動網站百寶箱 全新修訂版"這本書,在製作9-5補寄會員認證信時,出現一個問題:判別資料集是否是空的時,如果填的電子郵件是對的,就可以成功寄出;但如果填的是錯誤的電子信箱,就會產生例外狀況.... 錯誤類型: (0x80020009) 發生例外狀況。 /web/forget2.asp, line 81 我們的程式碼如下: <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../Connections/kaladucks.asp" --> <% Dim forget__MMColParam forget__MMColParam = "1" If (Request.Form("User_mail") <> "") Then forget__MMColParam = Request.Form("User_mail") End If %> <% Dim forget Dim forget_numRows
Set forget = Server.CreateObject("ADODB.Recordset") forget.ActiveConnection = MM_kaladucks_STRING forget.Source = "SELECT User_id, User_ped, User_mail FROM dbo.userdata WHERE User_mail = '" + Replace(forget__MMColParam, "'", "''") + "'" forget.CursorType = 0 forget.CursorLocation = 2 forget.LockType = 1 forget.Open()
forget_numRows = 0 %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>無標題文件</title> <style type="text/css"> <!-- body { background-color: #FFCC00; } body { background-color: #FFCC66; } a:link { color: #FFFFFF; } a:visited { color: #FFFFFF; } a:hover { color: #FF9900; } a:active { color: #FF9900; } .style3 {color: #FFFFFF} --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> <meta http-equiv="refresh" content="1;URL=main.asp"> </head> <body> <p> <% myMailServer = "127.0.0.1" sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = Server.CreateObject("CDO.Configuration") cdoConfig.Fields.Item(sch & "sendusing") = 2 cdoConfig.Fields.Item(sch & "smtpserver") = myMailServer cdoConfig.fields.update Set cdoMessage = Server.CreateObject("CDO.Message") Set cdoMessage.Configuration = cdoConfig cdoMessage.From = "angelchit@yahoo.com.tw" cdoMessage.To = Request("User_mail") cdoMessage.Subject = "卡拉鴨影音網密碼認證信" cdoMessage.HTMLBody = forget("User_id") & "親愛的會員您好:<br>您的密碼是" & forget("User_ped") cdoMessage.Send Set cdoMessage = Nothing Set cdoConfig = Nothing %> </p> <p> </p> <p> </p> <form name="form1" method="post" action=""> <% If Not forget.EOF Or Not forget.BOF Then %> <table width="602" border="1" align="center" bordercolor="#FF9900" bgcolor="#FF9900"> <tr> <td><div align="center" class="style3"> <p>親愛的會員!!!</p> <p>您的密碼已送達您的註冊信箱!!</p> <p><a href="main.asp">[回首頁]</a></p> </div></td> </tr> </table> <% End If ' end Not forget.EOF Or NOT forget.BOF %> <p> </p> <p> </p> <% If forget.EOF And forget.BOF Then %> <table width="602" border="1" align="center" bordercolor="#FF9900" bgcolor="#FF9900"> <tr> <td><div align="center" class="style3"> <p>很抱歉,您還不是我們的會員</p> <p>趕快加入我們吧!!!</p> <p><a href="main.asp">[回首頁]</a></p> </div></td> </tr> </table> <% End If ' end forget.EOF And forget.BOF %>
<p> </p> </form> <p> </p>
<p> </p> <div align="center"></div> </body> </html> <% forget.Close() Set forget = Nothing %>
請問該如何解決此問題呢??
|