[AccessD] Test for Recordset Existence

Hale, Jim Jim.Hale at FleetPride.com
Tue Dec 26 11:59:45 CST 2006


something like this will work if you set up your recordsets as array
elements.
Jim Hale

dim recset(1 To 5) As Recordset
.......
For x = 1 To 5
        If Not (recset(x) Is Nothing) Then recset(x).Close: Set recset(x) =
Nothing
    Next x

-----Original Message-----
From: Jim Lawrence [mailto:accessd at shaw.ca]
Sent: Tuesday, December 26, 2006 11:31 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Test for Recordset Existence


Hi Dan:

I do not think you can test for all open recordsets. It is the programmer's
responsibility to keep track of what is opened or closed. 

The following code will check to see if a specific recordset is open and
close it:

If Not MyRecordset Is Nothing Then MyRecordset.Close: Set MyRecordset =
Nothing  

HTH
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Tuesday, December 26, 2006 9:03 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Test for Recordset Existence

During error handling, I want to test for the existence of a DAO recordset.
If the recordset has been set but not closed and set to nothing, then I want
to close it and set it to nothing.

How do I do this?


Thanks!
Dan Waters


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.


More information about the AccessD mailing list