If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Exception occurred.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-03, 12:06
lslars31 lslars31 is offline
Registered User
 
Join Date: Jun 2003
Location: Minnesota
Posts: 61
Post 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
Reply With Quote
  #2 (permalink)  
Old 07-23-03, 01:19
Memnoch1207 Memnoch1207 is offline
Registered User
 
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") & "'"
Reply With Quote
  #3 (permalink)  
Old 07-23-03, 12:31
lslars31 lslars31 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 08-31-03, 08:20
soyadude soyadude is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On