473,422 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,422 software developers and data experts.

Error Type: (0x80020009) Exception occurred.

Si
I get the following error from the code below:

Error Type: (0x80020009)
Exception occurred.
/diary.asp, line 53
The specific part that causes the exception is when I try to access
rsAppsTemp("AppointmentDate") in the While loop. For some reason it works
fine in the If statement above it, but not in the While loop.

Any ideas?
=========

Function DiaryEntry(DBDate, LoopDate, HourVal, rsAppsTemp)
If IsDate(rsAppsTemp("AppointmentDate")) And IsNumeric(LoopDate) And
IsNumeric(HourVal) And Not rsAppsTemp.EOF Then 'validate input
If Day(rsAppsTemp("AppointmentDate")) = LoopDate Then ' LoopDate is a
date value representing day of month from 1 to 31
If CInt(Hour(rsAppsTemp("AppointmentDate"))) = CInt(HourVal) Then '
HourVal represents the hour from 0 to 23
While CInt(Hour(rsAppsTemp("AppointmentDate"))) = CInt(HourVal) 'THIS
IS LINE 53
Response.write rsAppsTemp("Postcode") & " (" &
ShortenString(rsAppsTemp("BusinessName"), 10) & ") " & "<br/>"
rsAppsTemp.MoveNext
Wend
Else
Response.write "&nbsp;"
End If
End If
End If
End Function


Feb 13 '06 #1
6 34237
Si wrote:
I get the following error from the code below:

Error Type: (0x80020009)
Exception occurred.
/diary.asp, line 53

Do any of the possibilities in this article apply?
http://www.aspfaq.com/show.asp?id=2421

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Feb 13 '06 #2
Si wrote:

Function DiaryEntry(DBDate, LoopDate, HourVal, rsAppsTemp)


This is extremely poor programming practice. When using a value from an
object more than once, assign the value to a variable.

dim appt
appt=rsAppsTemp("AppointmentDate").value

Now go through your subsequent code in this function and replace
rsAppsTemp("AppointmentDate") with appt. Your problem will be resolved.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Feb 13 '06 #3
Si
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:ea**************@tk2msftngp13.phx.gbl...
Si wrote:
I get the following error from the code below:

Error Type: (0x80020009)
Exception occurred.
/diary.asp, line 53

Do any of the possibilities in this article apply?
http://www.aspfaq.com/show.asp?id=2421


I'm fairly certain they don't.

I'm probably wrong but I suspect that the exception is somehow due to the
fact that the "AppointmentDate" field data cannot be accessed from the
rsAppsTemp recordset due to the MoveNext applied to it within the loop. I
reckon it is failing after one iteration of the loop, but I just don't know
how to get round the problem.
Feb 13 '06 #4
Si
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:et**************@tk2msftngp13.phx.gbl...
Si wrote:

Function DiaryEntry(DBDate, LoopDate, HourVal, rsAppsTemp)
This is extremely poor programming practice. When using a value from an
object more than once, assign the value to a variable.


I'm aware that this isn't a good idea, but I have been trying various
methods to get round this problem and as a consequence my code is in a bit
of a mess.
dim appt
appt=rsAppsTemp("AppointmentDate").value

Now go through your subsequent code in this function and replace
rsAppsTemp("AppointmentDate") with appt. Your problem will be resolved.


But then the problem with that is that rsAppsTemp("AppointmentDate") which
is used in the While loop will not be updated with the rsAppsTemp.MoveNext.
In other words it will stay the same and the loop will continue until EOF.
Feb 13 '06 #5
Si wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:et**************@tk2msftngp13.phx.gbl...
Si wrote:

Function DiaryEntry(DBDate, LoopDate, HourVal, rsAppsTemp)


This is extremely poor programming practice. When using a value from
an object more than once, assign the value to a variable.


I'm aware that this isn't a good idea, but I have been trying various
methods to get round this problem and as a consequence my code is in
a bit of a mess.
dim appt
appt=rsAppsTemp("AppointmentDate").value

Now go through your subsequent code in this function and replace
rsAppsTemp("AppointmentDate") with appt. Your problem will be
resolved.


But then the problem with that is that rsAppsTemp("AppointmentDate")
which is used in the While loop will not be updated with the
rsAppsTemp.MoveNext. In other words it will stay the same and the
loop will continue until EOF.


I meant that you should assign the value to the variable in the loop. Sorry
I did not make that clear.

Actually, my preference would be to use a GetRows array rather than a
recordset loop. Here is an example of looping through a getrows array:
http://www.aspfaq.com/show.asp?id=2467

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Feb 13 '06 #6


Si wrote:
I get the following error from the code below:

Error Type: (0x80020009)
Exception occurred.
/diary.asp, line 53
The specific part that causes the exception is when I try to access
rsAppsTemp("AppointmentDate") in the While loop. For some reason it works
fine in the If statement above it, but not in the While loop.

Any ideas?

Change your while loop to check for eof.

While not rsAppsTemp.EOF
if CInt(Hour(rsAppsTemp("AppointmentDate"))) = CInt(HourVal)
Response.write rsAppsTemp("Postcode") & " (" &
ShortenString(rsAppsTemp("BusinessName"), 10) & ") " & "<br/>"
rsAppsTemp.MoveNext
end if
Wend
MikeR
Feb 14 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brian Shade | last post by:
Hi all. I am having a bit of a problem with my Perl script and the creation of a chart. I can create the chart and create a new SeriesCollection. I then specify the XValues and the Values parameter...
12
by: Lakrom | last post by:
Gentlemen a warm greeting of New Year, that everything is happy next to their dear family and beings. Now to the subject, I have an error of exception in this subroutine. The error is:(0x80020009)...
11
by: Vijay Chegu | last post by:
I have built a 64bit ATL COM dll. When i register the dll on IA64 windows Enterprise server 2003, i get following error. DllRegisterServer in mydll.dll failed. Return code was : 0x80020009 ...
1
by: Marco Gerlach | last post by:
Hello, on one of our customers servers we get following error on first ASPX-page: An error occurred while try to load the string resources (GetModuleHandle failed with error -2147023888) ...
1
by: active | last post by:
ANYONE HAVE ANY IDEA WHAT IS CAUSING THESE ERRORS. HAPPENS ONLY IF I "START' NOT IF I "START WITHOUT DEBUG" I HAVE NO IDEA WHERE TO LOOK FOR THE BUG An unhandled exception of type...
8
by: jcrouse | last post by:
I am using the following code to trap errors in a sub routine: Try Executable code Catch ex As Exception Dim strInputE As String = Application.StartupPath & "\Error.txt" Dim srE As...
4
by: neil brown | last post by:
Whenever I try and run a project in VB.NET 2003, all i get is: "An unhandled exception of type 'System.ArgumentException' occurred in Unknown Module. Additional information: The parameter is...
2
by: MadMike42 | last post by:
Hi, Ive got a web site hosted on Seem (www.seem.co.uk) it allows 1 Access Database and you can connect via DSN I have a message that scrolls across the top of the page, it can work, refresh,...
1
by: aasaif2000 | last post by:
Dear Sir Help me out. below is the error line: <input name="remarkss" type="text" id="remarkss" value="<%=trim(rs("remarkss"))%>"/>
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.