Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61

    Post Unanswered: Exception occurred.

    Heres the code:
    Code:
    <%
        'Dimension variables
        Dim adoCon
        Dim strAccessDB
        Dim rs
        Dim strSQL
    
        Set adoCon = Server.CreateObject("ADODB.Connection")
    
        strAccessDB = "news"
    
        adoCon.open = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=********; DBQ=" & Server.MapPath(strAccessDB)
    
        Set rs = Server.CreateObject("ADODB.Recordset")
    
        strSQL = "SELECT tblUsers.* FROM tblUsers WHERE tblUsers.Username='" & Username & "'"
    
        rs.Open strSQL, adoCon
    
    If Request.QueryString("Page") = "au" THEN
      If Request.QueryString("UN") = rs("Username") THEN
        If Request.QueryString("ID") = rs("ID_no") THEN
    
    Responce.Redirect("add_user.asp")
    
        End If
      End If
    End If
    
    Responce.Redirect("no_access.asp?")
    %>
    Why is it saying:

    error '80020009'
    Exception occurred.

    ????
    Mr. Lars

  2. #2
    Join Date
    Jan 2003
    Location
    Midwest
    Posts
    138
    first check to make sure you have a connection
    Code:
    If(adoCon.state = 1) then
       Response.write("Connection is open")
    else
       Response.write("Connection is closed")
    end if
    then
    check the query...try running the query from within the database itself

    where are you getting the Username variable from???
    Code:
    strSQL = "SELECT * FROM tblUsers WHERE Username = '" & Request.Form("Username") & "'"

  3. #3
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61

    Talking Figured it out!

    Thanks...

    I figured it out...
    The problem was that I uploaded the wrong database.

    LoL

    I have two of the same one except they are different.
    I hate when that happens.
    Mr. Lars

  4. #4
    Join Date
    Aug 2003
    Posts
    1

    Question Exception Occured

    The line that seems to be giving the problem is

    If rsCheckUser("Status")= 1 Then

    The thing is, it used to work before, the next day, it didn't work. The normal user's log in works fine, but I dunno bout the admin login. Argh. Help me please!

    If (Request.Form("password")) = rsCheckUser("OldPassword") Then
    Session("logged") = True
    Session("username") = Request.Form("username")
    rsCheckUser.Close
    rsCheckUser.Open strStatus, strCon
    If rsCheckUser("Status")= 1 Then
    Response.Redirect"adminhome.asp"
    Session("admin") = True
    rsCheckUser.Close
    End if
    Response.Redirect"home.asp?"
    Else
    Response.Redirect("login.asp?error=" & 1)
    End If


    The Error Message:

    Error Type:
    (0x80020009)
    Exception occurred.
    /loginvalidate.asp, line 45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •