Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error

Status
Not open for further replies.

anon47

Programmer
Nov 28, 2006
80
US
Below is the code I use to check to see if there has been and email associated with a companies account if so it gives them and error to enter another email. It works great however if the person has a number in there email such as abc123@abc.com it does not notice the email even if its in the system but if there email is abc@abc.com it will show it in the sytem and give the error corrrectly. Any help on this?

If rs.EOF Then
Else
If Trim(Request.Form("Email"))=Trim(rs("Email")) Then
Response.Write "<p><font size=6 ><b>Error</b></p><p><font size=3>No information was sent due to an error.<br>" & _
"<b>'Duplicate Emails'</b> are not allowed, the email you entered is already in our system.<br>" & _
"Please press the BACK button of the browser and enter another email for this account.</p>"
Response.End
End If
End If
 
Never mind I think I did something to the email field on the server so I deleted the field and recreated it and it works perfect .
 
I was wrong here is the code that works:

sql = "SELECT * FROM [Clients] WHERE [Clients].='" &Trim(Request.Form("Email"))&"' "
rs.open sql, conn

If rs.EOF Then
Else
If Trim(Request.Form("Email"))=Trim(rs("Email")) Then
Response.Write "<p><font size=6 ><b>Error</b></p><p><font size=3>No information was sent due to an error.<br>" & _
"<b>'Duplicate Emails'</b> are not allowed, the email you entered is already in our system.<br>" & _
"Please press the BACK button of the browser and enter another email for this account.</p>"
Response.End
End If
End If
rs.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top