Link to home
Start Free TrialLog in
Avatar of pborregg
pborreggFlag for United States of America

asked on

Page doesn't load all recordsets. Need a ONE TIME page refresh on load...

Experts, I'm back again... I have over 1300 lines of code and posting it is going to bore you half to death.  Here's the situation: I have a page that loads and not all the recordsets load the first time. I get an EOF or BOF error, "Sometimes".  Then you refresh the page and the error goes away.

Here's the error:
ADODB.Field error 800a0bcd

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

/webproject/project-dashboard.asp, line 1330

The problem isn't EOF or BOF because when I refresh the page, there's no error.  It doesn't make sense. It happens only for some users and not others. I have totals that are coming in from the database and either I get the results from a previous project or all "0s" (Zeros).  Then I refresh the page and all the totals are there. Bizzar.

To me, it doesn't make any sense why on a refresh (reload) the page retrieves the data fine but on first load it doesn't.  I have the proper meta tags for PRAGMA No-Cache and the like so that's not the problem.

Trying a window.location.reload() firing this from the BODY ONLOAD event causes an infinite reloading loop. Not good.

So how do I cause a REFRESH ONLY ONCE when this page loads or am I looking at a bigger problem or something really simple?  If you really want the code, I'll paste it... but believe me, it's over 1300 lines.
SOLUTION
Avatar of MaxOvrdrv2
MaxOvrdrv2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Kin Fat SZE
Kin Fat SZE
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pborregg

ASKER

You're all geniuses...

I have to rebuild the code you wrote.... MaxOvrdrv2 for JScript but it works nonetheless.

if(Request.QueryString("pid")=="" || Request.QueryString("pid")==null)
{
   Response.Redirect("project-dashboard.asp?pid=Session('SV_PID')");
}

fsze88 your code works too... I had to add them both and they're working in tandum. Brilliant!!!!
FSZE 88: can you explain your code above in Psuedo-Code so I can explain it to the NON-PROGRAMMERS please?

Thanks.

Peter
Okey, sure!
It is reading cookie variables from each client. cookie means client browsers local variable, each browsers (ie, ff, safari, opera, chrome) having their own cookie variable.... e.g. you can store cookie at ie browser and read it as well, but it can't be read by another browser and so on of ff, safari, opera..
I have javascript function setCookie(c_name,value,expiredays) that store variable name, value, expireday. getCookie(c_name) return the value of variable of the name c_name....
at the beginning, there is no cookie on browsers so the first line
var reloaded = getCookie('reloaded');
it should be '',  set the variable named reloaded to be true and force it to be reload by window.location.reload();
after refreshed set the variable named reloaded to false and force it to be reload by window.location.reload(); in later on...