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 occured error?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-04, 19:19
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
Angry Exception occured error?

(0x80020009)
Exception occurred.

all rsDates.Open("SELECT PeriodStartDate, PeriodEndDate from Trim.dbo.ExpenseAllocationsRelocatee " & _
"where PONumber=" & BuildString(rs("PONumber")),myCon)
Response.Write("<TD align=right><H1>Actual Date In:</H1></TD>")
if IsNull(rsDates("PeriodStartDate")) = false then
Response.Write("<TD>" & FormatDateTime(rsDates("PeriodStartDate"), vbShortDate) & "</TD>")
else
Response.Write("<TD></TD>")
end if
rsDates.close


This is the code I am using to list/display values submitted,BuildString is just a function created to look after strings obviously,but it gives me this bizarre error on this line of code "if IsNull(rsDates("PeriodStartDate")) = false then
Response.Write("<TD>" & FormatDateTime(rsDates("PeriodStartDate"), vbShortDate) & "</TD>")
else
Response.Write("<TD></TD>")"

Can somebody at leas explain to me what does it mean, I don't even know what to look for in order to solve this problem?
Reply With Quote
  #2 (permalink)  
Old 10-14-04, 20:27
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
I suspect you are trying to format a null value. This would probably cause the exception. Or perhaps you have a value that can't be represented as a short date.... do a response.write on the rsDates("PeriodStartDate") value before you try your formating etc.
Reply With Quote
  #3 (permalink)  
Old 10-15-04, 00:11
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
No it not a null value, i know what I am suppose to see and i have tried without formatting function, NO LUCK!

I just can't recognize what it could be, that drives me nuts!
Reply With Quote
  #4 (permalink)  
Old 10-15-04, 00:16
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
have you done a response.write on the rsDates("PeriodStartDate") value to see what you are trying to convert to a date time value?
Reply With Quote
  #5 (permalink)  
Old 10-17-04, 18:54
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
Yes I have done that and removed the function for date formatting but the error is still the same, it points to this line of code "Response.Write("<TD>" & rsDates("PeriodStartDate") & "</TD>")"
which means there is something wrong but the error is not descriptive enough for me to know what to look for.

if IsNull(rsDates("PeriodStartDate")) = false then
Response.Write("<TD>" & rsDates("PeriodStartDate") & "</TD>")
else
Response.Write("<TD></TD>")
end if
Reply With Quote
  #6 (permalink)  
Old 10-17-04, 19:04
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Okie, that is kinda weird and would lead me to suspect that the line that is being reported in error is not the line where the error is actually occuring. Can you post the entire code?
Reply With Quote
  #7 (permalink)  
Old 10-17-04, 20:04
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
The code I have posted so far is the entrie code for this field,the entire entire code is huge,don't worry about it, it would be hard to help me without seeing the whole code and our db and business we do, i just wanted to know what this error means a bit more in order to atack it, but there is not much out there.

Thanks for your help
Reply With Quote
  #8 (permalink)  
Old 10-17-04, 20:29
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Well from the code shown there is nothing going wrong to explain what the error might mean (assuming of course that your field name and recordset are correct).

Sorry I couldn't be of more help.
Reply With Quote
  #9 (permalink)  
Old 10-17-04, 21:15
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
Just to let you know I was able to resolve it,thank God. There is nothing like being on your own and working 110%.

Thanks for all your help
Reply With Quote
  #10 (permalink)  
Old 10-17-04, 21:17
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Excellent, well done. Was it anything to do with that like of code? Was there something I was missing??
Reply With Quote
  #11 (permalink)  
Old 10-17-04, 21:22
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
It is basically the sql and the way application works with db, you couldn't have known that one Purchase order no. belongs to muliple entries but gets displayed once etc. complicated and then making sure there is an entry...

so this query call rsDates.Open("SELECT Min(PeriodStartDate) as StartDate, Max(PeriodEndDate) as EndDate from Trim.dbo.ExpenseAllocationsRelocatee " & _
"where PONumber=" & BuildString(rs("PONumber")),myCon)
Reply With Quote
  #12 (permalink)  
Old 10-17-04, 21:47
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
yay! Glad I didn't miss something.
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