Web Analytics Made Easy -
StatCounter Email validation & HTTP 500.100 Error - CodingForum

Announcement

Collapse
No announcement yet.

Email validation & HTTP 500.100 Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Email validation & HTTP 500.100 Error

    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

  • #2
    In IE > Tools > Internet Options > Advanced > Show Friendly HTTTP error messages -- Turn OFF that checkbox.

    Then you'll get the WHOLE error message which should help you narrow down the problem.
    Check out the Forum Search. It's the short path to getting great results from this forum.

    Comment


    • #3
      The error:

      Error Type:
      Provider (0x80004005)
      Unspecified error
      /email.asp, line 46

      that's this line:

      objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("email.mdb"))

      If I do something like "On Error Resume Next" I get:
      "Operation is not allowed when the object is closed"


      ??

      Comment


      • #4
        I would believe your whole error is caused by you placing a function in the middle of the code....move the function to above the other code.
        Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

        Comment


        • #5
          If that doesn't work, then the error being specified is a real pain. I just had to diagnose the problem last week, it has to do with permissions and the connection string.

          Try changing the connection string to:
          objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=;DBQ=" & Server.MapPath("email.mdb"))
          OracleGuy

          Comment


          • #6
            I solved it. It had to do with the write permissions.
            Thanks,
            DanielTech

            Comment

            Working...
            X