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

10-14-04, 19:19
|
|
Registered User
|
|
Join Date: Feb 2004
Location: Australia
Posts: 183
|
|
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?
|
|

10-14-04, 20:27
|
|
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.
|
|

10-15-04, 00:11
|
|
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!
|
|

10-15-04, 00:16
|
|
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?
|
|

10-17-04, 18:54
|
|
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
|
|

10-17-04, 19:04
|
|
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?
|
|

10-17-04, 20:04
|
|
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
|
|

10-17-04, 20:29
|
|
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.
|
|

10-17-04, 21:15
|
|
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
|
|

10-17-04, 21:17
|
|
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??
|
|

10-17-04, 21:22
|
|
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)
|
|

10-17-04, 21:47
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
|
|
yay! Glad I didn't miss something. 
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|