By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Help with recordset.bof / eof

P: n/a
Hi all,

I need some help with using recordset.bof / oef.

I'm using HTML file to display XML records page by page.

I need to disable the moveNext button once it reaches the end of the
file but it seems to occur one page too late.

that's the function I used for the onclick of the button:

function Next()
{
if (!mydata.recordset.EOF)
{
mydata.recordset.moveNext();
}
else
{
btn_next.disabled = true;
}

}
Any ideas?
Feb 5 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hey, thanks! it's pretty close..

Now I've noticed that before changin the code it was two pages late -
now it's only one page late.

Somehow it doesn't detect that last record as the last one.
Feb 5 '08 #2

P: n/a
Jim Aikin wrote on 05 feb 2008 in comp.lang.javascript:
>I need some help with using recordset.bof / oef.
[Please do not toppost on usenet]
I'm strictly a hobbyist programmer, and this answer is quite likely
wrong -- but have you tried this:
restyled:
function Next() {
if (!mydata.recordset.EOF) {
mydata.recordset.moveNext();
if (mydata.recordset.EOF) btn_next.disabled = true;
} else {
btn_next.disabled = true;
};
};
shorter:

function Next() {
if (!mydata.recordset.EOF)
mydata.recordset.moveNext();
if (mydata.recordset.EOF)
btn_next.disabled = true;
};

or even:

function Next() {
if (!mydata.recordset.EOF)
mydata.recordset.moveNext();
btn_next.disabled = mydata.recordset.EOF;
};
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 5 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.