Hi,
I am trying to validate the email in a form and then insert them into a database. I try the validation and it works, however when I try to populate a database with the emails it works the first time, after that it gives me the HTTP 500.100 Error. Here is my code:
<%
Dim strSql
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Emails.mdb"))
Dim email, ID
email= Request.Form("email")
Dim flag
flag = False
Function ValidEmail(email2)
Dim veRegEx
Set veRegEx = New RegExp
veRegEx.Pattern = "^[\w\.-][email protected][\w\.-]+\.[a-zA-Z]{2,}"
ValidEmail = veRegEx.Test(email2)
End Function
If ValidEmail(email) = True Then
Response.Write "The email is good!"
flag= True
Else
Response.Write "The email is bad!"
flag =False
End If
'I am suppose to insert the emails into the database here but I got the error even before inserting anything
objConn.Close
Set objConn =Nothing
%>
Thanks,
DanielTech
I am trying to validate the email in a form and then insert them into a database. I try the validation and it works, however when I try to populate a database with the emails it works the first time, after that it gives me the HTTP 500.100 Error. Here is my code:
<%
Dim strSql
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Emails.mdb"))
Dim email, ID
email= Request.Form("email")
Dim flag
flag = False
Function ValidEmail(email2)
Dim veRegEx
Set veRegEx = New RegExp
veRegEx.Pattern = "^[\w\.-][email protected][\w\.-]+\.[a-zA-Z]{2,}"
ValidEmail = veRegEx.Test(email2)
End Function
If ValidEmail(email) = True Then
Response.Write "The email is good!"
flag= True
Else
Response.Write "The email is bad!"
flag =False
End If
'I am suppose to insert the emails into the database here but I got the error even before inserting anything
objConn.Close
Set objConn =Nothing
%>
Thanks,
DanielTech
Comment