//flex table opened by JP

Click to See Complete Forum and Search --> : ASP Recordset Updating


LuisRivera
12-09-2001, 12:58 PM
I am having a problem using recordset updating in my asp pages, basically i have created a connection to a SQL server db using a include file to store the connection string.

Then a page opens, creates a recordset which filters out one record, this recordset is stored in a Session variable so that i can allow updates in other pages without reopening the db.

I don't close this recordset or the connection (which is simply stored as a conn variable).

I have updated all the pages which used to use sql update functions to use recordset update functions as they all update this one record anyway.

The problem is that although some of my pages work fine others just will not load, they simply keep loading (this is using an internal iis system on 2000 server)

I tried using a variable instead of a session for the recordset and closing the recordset and connection at the end of each page but no dice, i also have found that this problem also occurs on a page which does not contain any association with the recordset just the connection.

I know that these pages worked before as the update recordset was a new feature that i thought would be more effecient.

I created a more minimal version of the connection and recordset for testing purposes and the updating worked fine.

Any information on the ins and outs of recordset problems would be useful.

qball
12-10-2001, 08:05 PM
real quickly, isn't this a problem:


Then a page opens, creates a recordset which filters out one record, this recordset is stored in a Session variable so that i can allow updates in other pages without reopening the db.


Since the recordSet is created in the ASP file, like:

Set objRec = Server.CreateObject ("ADODB.Recordset")

and then "stored in a Session variable", like:

sessionRec = objRec

Later:

objRec.Close //else memory leak!

When that ASP file completes you lose the reference to your recordset in the session variable.

If you wanna use one connection and recordset per session, create object at session start, manipulate during session (perhaps updating), update and close at session end(though you may want some validation).

steve2
12-17-2001, 08:31 PM
Just a thought but if you are searching your db are your using a do until, or simmilar to tell it to stop at end of file?

It might just be going around & around?
steve2