Closed Thread Icon

Topic awaiting preservation: Display problem (ASP) (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=12987" title="Pages that link to Topic awaiting preservation: Display problem (ASP) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Display problem (ASP) <span class="small">(Page 1 of 1)</span>\

 
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 11-17-2003 04:20

Hi, guys. How are you?
I have been having a problem about EOF things.
I made a couple of dropdown box which user can query what they need quickly.
So SQL statment is dynamic, which is cool.
But sometimes those query itself doesn't pick up any data cuz it is simply not existing.
I want to show "No Product found" if query doesn't pick up any data otherwise, "You've found".
What I did is following:

code:
<table><tr><td><%If rs.EOF Then%>No Product found!<%Else%>You've foound:<%End IF%></td></tr></table>
<div style="display:<%If rs.EOF Then%>none<%End IF%>">
<table align="center">
<%If Not rs.EOF Then%>
<%Do Until rs.EOF or recct >= maxrecs
<!-- here makes table body -->
Loop
End If
%>
</table>



What I meant was:

1. If data doesn't exist, get "No product found" otherwise "You've found"
This part works fine.

2. If data doesn't exist, don't do Do until Loop.
I guess this bit is causing error. Not sure how to deal with this.

Well, at the moment it works fine as long as data exist. But when not exists, just cause error.
It said:

quote:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.



Hmm......Do you see something wrong???
Please tell me.
Cheers.

Hiroki Kozai

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 11-17-2003 04:51

Hi, I changed my code to like"

code:
<table align="center">
<%If rs.EOF Then
Response.write("<tr><td>No Producttttt</td></tr>")
Else
Do until rs.EOF or recct >= maxrecs
Response.Write("<tr>")
Response.Write("<td><b>")
Response.Write(rs("WineryName") & "&nbsp;" &rs("Name"))
Response.Write("</b></td>")
Response.Write("</tr>")
rs.MoveNext
recct = recct + 1
Loop
End IF
%>
</table>



But still doesn't work. I thought it would.
Do you see something????


Hiroki Kozai

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 11-17-2003 23:28

Hi, I figured out.
The problem was related to page index things.
I changed this:

code:
rs.absolutepage = pg



to:

code:
If Not rs.BOF Then 
rs.absolutepage = pg
End IF



Now it is working.
Many thanks.
Cheers.


Hiroki Kozai

« BackwardsOnwards »

Show Forum Drop Down Menu