Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error '80020009' with DatePart

Status
Not open for further replies.

Zippeh

Programmer
Sep 24, 2002
56
GB
Hi there,

I get the following error message when executing my ASP:

Code:
error '80020009'

/corystadegauelk/includes/ffwythiannau.asp, line 90

and line 90 is as follows:
Code:
    datAmserFynu = DatePart("YYYY", rstAmserFynu("test_time")) & "/" & DatePart("M", rstAmserFynu("test_time")) & "/" & DatePart("D", rstAmserFynu("test_time")) & " "  &  DatePart("H", rstAmserFynu("test_time")) & ":" & DatePart("N", rstAmserFynu("test_time")) & ":" & DatePart("S", rstAmserFynu("test_time"))

The weird thing is, this script was working perfectly, then all of a sudden it doesn't work at all! The column "test_time" is the only column returned by the stored procedure into the recordset. So it can't the the TEXT/BLOB problem the error says on the Microsoft site. Any ideas?
 
DatePart([red]"N"[/red], rstAmserFynu("test_time"))

did you mean to say [blue]M[/blue] there

-DNG
 
that error means that you have a empty value for rstAmserFynu("test_time")...make sure that it is not empty

-DNG
 
Thanks for that! Funny that, isn't an empty recordset error usually different?
 
Hi,
I'm new in this forum, so please forgive me if I post in the wrong place...

I have developed a search engine in VBA, that works with an Access DB.

On my computer, everything works wonderful and there are absolutely no problems.
However, as soon as I upload it to the server the problems begin:

1. the encoding is wrong, although I defined it in the global.asa:
sub session_onstart()
session.CodePage=1250
end sub

as well as on every page:
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1250">

1250 is central european and should support letters such as í, ? and á.
as I said, on my computer it works, but on the server it just shows question marks. I tried on another server and there it shows other characters. So I guess it's server dependant? what server should I look for?

2. and even worse: almost every search on the server gives me an error:
error '80020009'
SearchResults_new.asp, line 233

this line is:
Response.Write("<td class='TableBorder'><a href='ItemPage_new.asp?selectLocation=" & rsInternal.Fields(2) & "&selectDate=" & rsInternal.Fields(12) & "'><img border=0 src='images/monocular.jpg'></a></td>")

what I'm trying to do is have a little picture next to each item in the search results, that, once clicked, redirects to another page where the item is fully displayed. Since the items in the DB have no unique id, I need to transfer the date and location so that I can search for it again on the ItemPage_new.asp.

the page can be found here

the complete function that includes the above line:


Code:
private sub WriteResult(sqlstmt)

dim datpath ' Access file location
dim conn ' connection to file
dim rs ' Query record set
dim rsInternal ' Query record set for internal loop (check for every date + Location)

' Connect to access
datpath=Server.MapPath("Input\concerts_new.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
call conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & datpath)

' Create new record set
Set rs = Server.CreateObject("ADODB.Recordset")
call rs.Open(sqlstmt, conn, adOpenDynamic)

' Write result
if rs.EOF then
Response.Write("No concerts were found to match your query")
Response.Write("<br><a href='javascript:history.go(-1)'>Back to search</a>")
else

'Table titles
Response.Write("<table cellSpacing=0 cellPadding=2 border=0 style='font-family: Verdana; font-size: 10px;'>")
Response.Write("<tr style='font-weight:bold; font-style:italic; color:blue;'>")
Response.Write("<td>View Item</td>")
Response.Write("<td>Date</td>")
Response.Write("<td>Location</td>")
Response.Write("<td>Hall</td>")
Response.Write("<td>Orchestra</td>")
Response.Write("<td>Concert Name</td>")
Response.Write("<td>Composer</td>")
Response.Write("<td>Work</td>")
Response.Write("<td>Performing Artists</td>")
Response.Write("<td>Radio Recordings</td>")
Response.Write("</tr>")

'Table contents
do until rs.EOF ' while there are rows in the RS
if rs.Fields(0)<>"" then
sqlstmt = "SELECT * FROM ConcertDetails WHERE ConcertDetails.Date1=#" & rs.Fields(0) &_
"# AND ConcertDetails.Location Like '%" & rs.Fields(1) & "%' ORDER BY ConcertDetails.Order;"
else 'if there is no date
sqlstmt = "SELECT * FROM ConcertDetails WHERE ConcertDetails.Date1 IS NULL AND ConcertDetails.Location Like '%" & rs.Fields(1) & "%' ORDER BY ConcertDetails.Order;"
end if


Set rsInternal = Server.CreateObject("ADODB.Recordset")
call rsInternal.Open(sqlstmt, conn, adOpenDynamic)

'print first line
Response.Write("<tr valign='top'>") 'rsInternal.Fields(12)=Date1; 'rsInternal.Fields(2) =Location
'Response.Write("<td class='TableBorder'>&nbsp;</td>")
Response.Write("<td class='TableBorder'><a href='ItemPage_new.asp?selectLocation=" & rsInternal.Fields(2) & "&selectDate=" & rsInternal.Fields(12) & "'><img border=0 src='images/monocular.jpg'></a></td>")
Response.Write("<td class='TableBorder' style='width: 120px;'>")
for i=12 to 31 'date1 to date20
if IsNull(rsInternal.Fields(12)) then 'if the field is empty still build a td
Response.Write("&nbsp;")
end if
if rsInternal.Fields(i)<>"" then
'myValue = Day(rs.Fields(0)) & " " & MonthName(Month(rs.Fields(0))) & ", " & Year(rs.Fields(0))
myValue = Day(rs.Fields(0)) & "/" & Month(rs.Fields(0)) & "/" & Year(rs.Fields(0))
'Response.Write(rsInternal.Fields(i) & "<BR>")
Response.Write(myValue & "<BR>")
end if
next
Response.Write("</td>")

for i=2 to 9 '2=Location; 3=Hall; 4=Orchestra; 5=ConcertName; 6=Composer; 7=Work; 8=Artist; 9=Radio
if IsNull(rsInternal.Fields(i)) then 'if the field is empty still build a td
Response.Write("<td class='TableBorder'>&nbsp;</td>")
else
dim myValue
myValue = replace(rsInternal.Fields(i),";","<BR>")
Response.Write("<td class='TableBorder'>" & myValue & "</td>")
end if
next
Response.Write("</tr>")
rsInternal.MoveNext ' next row

'print next lines
Response.Write("<tr valign='top'>")
do while not rsInternal.EOF ' while there are rows in the Internal RS
Response.Write("<td>&nbsp;</td>")'0 id
Response.Write("<td>&nbsp;</td>")'1 Order
Response.Write("<td>&nbsp;</td>")'2 location
Response.Write("<td>&nbsp;</td>")'3 hall
Response.Write("<td>&nbsp;</td>")'4 orchestra
Response.Write("<td>&nbsp;</td>")'5 concert name

for i=6 to 8 '6=composer; 7=work; 8=artists
if IsNull(rsInternal.Fields(i)) then 'if the field is empty still build a td
Response.Write("<td>&nbsp;</td>")
else
myValue = replace(rsInternal.Fields(i),";","<BR>")
Response.Write("<td>" & myValue & "</td>")
end if
next

Response.Write("<td>&nbsp;</td>")'9 radio recording
Response.Write("</tr>")
rsInternal.MoveNext ' next row
loop
rs.MoveNext
loop
Response.Write("</table>")

end if

' close all
rs.Close
conn.Close

end sub

I did all kinds of checks and there are no empty fields there. field count returns 32, and the fact is that it works on my computer!

PLEASE help me... It drives me nuts!
Thanks,
Efrat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top