Recordsets not closing on 1 machine???

Soma_rich

Registered User.
Local time
Today, 15:13
Joined
May 2, 2007
Messages
58
I have 1 user who is constantly getting poor performance from my front end, combo boxes hanging and complete crashes. On investigation it looks like all my recordsets will not close on his machine.

I am using the below code to close all of my recordsets at the correct time and searched the whole database for cases where i have missed one.

strRecordsetName.Close
Set strRecordsetName = Nothing

I messaged boxed the state of all recordsets on his machine and they are at sate 1, on everybody else’s machine they are state 1.

Any ideas on why 1 machine might not close a recordset ?? HELP!

I should probably say this is Access 97 *hangs head in shame*
 
For various reasons, this type of code is basically meaningless: -

strRecordsetName.Close
Set strRecordsetName = Nothing

I think you should post the entire database.
 
I couldnt post the entire DB its HUGE. I think i have solved it. It seems the Set strRecordsetName = Nothing was not working in some places as it did not have a strRecordsetName.Close.
 
I have never seen any example of failing to close a recordset and/or failing to set it to nothing that has ever caused any problems whatsoever in any version of Access.

Please post your example!

strRecordsetName.Close
Set strRecordsetName = Nothing

The above code indicates that you may be doing something else which might cause the problem.

str is a naming convention prefix given to a String. A String does not have a Property of Close and you can not set it to Nothing...
therefore, if you wrote it correctly then strRecordsetName.Close should raise an error in all Access versions as should Set strRecordsetName = Nothing.

There is a good chance that you are not using Option Explicit and that strRecordsetName is not a String and not a Recordset (ADO or DAO) but is in fact a Variant.

You would be hard pressed to find an Access version more stable than Access 97.

I can make many more guesses, but I don’t want to be here all night.

Please post your real example!
 
Last edited:
Thanks ChrisO, the only thing I changed was to include a rst.close to all the instances of a rst opening and it seems to have solved the issue on the machine in question. I found reference online to different installs not liking the set.rst = nothing and this does seem to be the case.

I would rather not post the whole DB.


Is there much Access/oracle work in Brisbane, I will be emigrating in the next few years. Lovely city when I was there a few years ago.
 
I doubt if your fix actually fixed anything.
Sometimes the things that we do simple look like fixes but merely gloss over the muddy waters.

Is there much Access/oracle work in Brisbane?
Don’t know, these days I earn more money from HMI construction and drafting electrical drawings.
 
Hey i dont mind muddy waters/code as long as the users are happy and dont moan at me :)
 

Users who are viewing this thread

Back
Top Bottom