943,771 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 7950
  • ASP RSS
Jan 31st, 2007
0

error '80020009' Exception occurred.

Expand Post »
For some reason I keep getting the following error:
asp Syntax (Toggle Plain Text)
  1. error '80020009' Exception occurred.
It applies to the line of code:
asp Syntax (Toggle Plain Text)
  1. If (cInt(objRS("User_ID")) = Cookie_ID) Then

for some reason it freaks out with "cInt(objRS("User_ID"))" when it runs through the db to find a User ID that matches that in their cookie. I have also found that if I alter the code, remove cInt(objRS("User_ID"))" from the above line of code, and add in an incremental integer based variable, it seems to work fine. I know it's not compairing the info from the DB, but this was the way I found what was causing the problem.


asp Syntax (Toggle Plain Text)
  1. Dim conn, mydb
  2. mydb=server.mappath("\fpdb\temp.mdb")
  3. set conn=Server.CreateObject("ADODB.Connection")
  4. conn.Provider="Microsoft.Jet.OLEDB.4.0"
  5. conn.Open mydb
  6.  
  7. Dim objRS, bolFound
  8.  
  9. set objRS = Server.CreateObject("ADODB.recordset")
  10. objRS.Open "User_Info", conn, , 3, 2
  11.  
  12. bolFound = False
  13.  
  14. Do Until objRS.EOF or bolFound
  15. If (cInt(objRS("User_ID")) = Cookie_ID) Then
  16. BolFound = True
  17. Else
  18. objRS.MoveNext
  19. End If
  20.  
  21. Loop
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
quicknk is offline Offline
2 posts
since Jan 2007
Feb 2nd, 2007
0

Re: error '80020009' Exception occurred.

Try to find out whether objRS("User_ID") has some records or not? Another thing is the data type of User_ID, is it int?

Mostly this exception occurs if you try to casst different data types of variables.
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
msaqib is offline Offline
91 posts
since Sep 2004
Feb 2nd, 2007
0

Re: error '80020009' Exception occurred.

Click to Expand / Collapse  Quote originally posted by msaqib ...
Try to find out whether objRS("User_ID") has some records or not? Another thing is the data type of User_ID, is it int?

Mostly this exception occurs if you try to casst different data types of variables.


cool, thanks. I figured out yesterday. The Access DB file had held on to a deletion from it's original programer leaving a "#deleted" in all fields for that spacific record. Causing the int data type for the User_ID to have an error. Im wasn't sure why it holds on to this deletion note, and it would not allow me to remove this record at all. I had to export it as a new Access DB file and then it allowed me to remove this record.

thanks again.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
quicknk is offline Offline
2 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: ASP- SQL Server..Query help....
Next Thread in ASP Forum Timeline: Code Giving Error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC