Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 9th, 2006, 09:34 PM
Registered User
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default error '80020009' Exception occurred.

Hi all,

I have a page that calls categories for the headings
'calls the cats for the page heading
set rs1 = My_Conn.Execute("SELECT * from tbl_cats where CatID = " & Request.QueryString("CatID"))
strCatID =  RS1("CatID")
'response.write strCatID
So far so good and the page works.

Later on I want to set up what to do, depending on the catID
<% if rs1("CatID") = strCatID  then %>
Fill in the form below
<% end if %>
However, this causes the above error.

I have also tried
<% if rs1("CatID") = 4 then %> AND
<% if rs1("CatID") <> 4 then %> AND just to see if it will work
<% if rs1("CatID") < 4 then %>
but still get the same error.

Any guidence will be much appreciated - thank you for your time :)

Old April 9th, 2006, 09:48 PM
Friend of Wrox
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

;;;However, this causes the above error
What error? I can not see a error, am I missing something??

is the record set empty? try:

<% if not rs1.Eof then
      if (rs1("CatID") = strCatID) then %>
         //Fill in the form below
      end if
<% else %>
      response.write "no records found
<% en if %>

FYI: are they integers you are comparing? if so use the cInt function around them

Wind is your friend
Old April 10th, 2006, 05:05 PM
Registered User
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Thank you for your reply mat41. The error message was
 error '80020009' Exception occurred
which I had put as the title to the post, but next time I will add it into the post as well - forgive me for that but I will learn how to post correctly as I go along :)

And Your code example has helped me to see what is happening, so I can get it fixed now :-)

thank you for your time - it is appreciated :-)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception occurred. basie Classic ASP Basics 3 September 4th, 2008 03:02 AM
Exception occurred ronny Classic ASP Basics 0 October 23rd, 2007 03:29 AM
error:Exception occurred hastikeyvan Classic ASP Professional 1 September 13th, 2006 04:40 AM
HELP PLEASE!! error '80020009' Brolin99 Classic ASP Professional 3 April 29th, 2006 02:20 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.