Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183

    Angry Unanswered: 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?

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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.

  3. #3
    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!

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    have you done a response.write on the rsDates("PeriodStartDate") value to see what you are trying to convert to a date time value?

  5. #5
    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

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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?

  7. #7
    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

  8. #8
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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.

  9. #9
    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

  10. #10
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Excellent, well done. Was it anything to do with that like of code? Was there something I was missing??

  11. #11
    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)

  12. #12
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    yay! Glad I didn't miss something.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •