首先,我要做的是将访问数据库链接到成功的站点。现在,我正在尝试在注册页面上显示一条特定消息,说明输入的电子邮件已经存在,如果确实存在,则代替通常在电子邮件存在时出现的 odbc 错误消息,但是我收到错误消息以显示它是否存在。我到目前为止所做的代码如下所示,我们将不胜感激了解可能出现的问题。
sql="INSERT INTO Customers (Customerfirstname, Customerlastname, Email, Password, Address, Phoneno) VALUES (' "&fname&"',' "&lname&"','"&email&"',' "&password&"',' "&caddress&"',' "&phno&"')"
on error resume next
Con.Execute sql
if err.number <> 0 then
response.write("E-mail already exist")
else
' append the query string to the redirect URL
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
end if
Response.Redirect(MM_editRedirectUrl)
con.close: set conn = nothing