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 When Formatting Date

Status
Not open for further replies.

charbrad

Technical User
Nov 7, 2002
132
US
I am receiving error:
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/*****/*****.asp, line 21
Code:
MyRecordSet.OPEN MySQL, ssddbb
dim stgdte
if MyRecordSet.fields("stgdte") <> "" or MyRecordSet.fields("stgdte") then
  stgdte = FormatDateTime(MyRecordSet.fields("stgdte"))
else
    stgdte = ""
end if 
MyArray = MyRecordSet.GETROWS()
FOR MyCursor = LBOUND(MyArray,2) TO UBOUND(MyArray,2)
body = body + "<TR><TD BGCOLOR=""" & SHADE & """>" & MyArray(0,MyCursor) & "&nbsp;</TD><TD WIDTH=300 ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """>" & 

MyArray(1,MyCursor) & "</TD><TD BGCOLOR=""" & SHADE & """>" & MyArray(2,MyCursor) & "&nbsp;</TD><TD ALIGN=""RIGHT"" BGCOLOR=""" & SHADE & """>" & 

MyArray(3,MyCursor) & "</TD><TD ALIGN=""RIGHT"" BGCOLOR=""" & SHADE & """>" & MyArray(4,MyCursor) & "</TD><TD ALIGN=""RIGHT"" BGCOLOR=""" & SHADE & """>" & 

[b]---->Line 21[/b] MyArray(5,MyCursor) & "</TD><TD ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """>" & [u]FormatDateTime(MyRecordSet.fields("stgdte").Value,2)[/u] & "</TD><TD 

ALIGN=""CENTER"" BGCOLOR=""" & SHADE & """>" & MyArray(7,MyCursor) & "</TD><TD BGCOLOR=""" & SHADE & """>" & MyArray(8,MyCursor) & " </TD><TD BGCOLOR= """ & 

SHADE & """>" & MyArray(9,MyCursor) & " </TD><TD ALIGN=""RIGHT"" BGCOLOR=""" & SHADE & """>" & MyArray(10,MyCursor) & " </TD></TR>" & vbcrlf
IF SHADE = "#FFFFFF" THEN SHADE = "#DDDDDD" ELSE SHADE = "#FFFFFF"
MyRecordSet.CLOSE

Any clue?
 
Found an easier way to include it in my select statement. Thanks anyway.
 
Why not convert that line to use MyArray instead of MyRecordSet?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top