D
David Anderson
I have an Access 2003 application that makes a lot of use of DAO for
handling the data. My primary form is designed so that all the required
recordsets are created when the form is opened, i.e. the Form_Open sub
contains the following code:
Set MyDB = DBEngine.Workspaces(0).OpenDatabase(strDBName)
Set rstUsers = MyDB.OpenRecordset("Users")
Set rstEntrants = MyDB.OpenRecordset("Entrants")
Set rstEntrySummary = MyDB.OpenRecordset("EntrySummary")
Set rstEntries = MyDB.OpenRecordset("Entries")
Set rstPayments = MyDB.OpenRecordset("Payments")
etc, etc
Rightly or wrongly, none of these recordsets are closed until the form
closes. My Form_Close sub contains the following code:
rstUsers.Close
rstEntrants.Close
rstEntrySummary.Close
rstEntries.Close
rstPayments.Close
etc, etc
Unfortunately, my MDB file steadily grows in size as this form is being
used. Even worse, the app occasionally gets really confused and starts to
present the data of one person when viewing another. This is always fixed by
a Compact & Repair.
I am speculating that my practice of leaving the recordsets open all the
time while the form is open may not be a good idea and may be the reason for
my problems. I would be grateful for any advice on this matter.
David
handling the data. My primary form is designed so that all the required
recordsets are created when the form is opened, i.e. the Form_Open sub
contains the following code:
Set MyDB = DBEngine.Workspaces(0).OpenDatabase(strDBName)
Set rstUsers = MyDB.OpenRecordset("Users")
Set rstEntrants = MyDB.OpenRecordset("Entrants")
Set rstEntrySummary = MyDB.OpenRecordset("EntrySummary")
Set rstEntries = MyDB.OpenRecordset("Entries")
Set rstPayments = MyDB.OpenRecordset("Payments")
etc, etc
Rightly or wrongly, none of these recordsets are closed until the form
closes. My Form_Close sub contains the following code:
rstUsers.Close
rstEntrants.Close
rstEntrySummary.Close
rstEntries.Close
rstPayments.Close
etc, etc
Unfortunately, my MDB file steadily grows in size as this form is being
used. Even worse, the app occasionally gets really confused and starts to
present the data of one person when viewing another. This is always fixed by
a Compact & Repair.
I am speculating that my practice of leaving the recordsets open all the
time while the form is open may not be a good idea and may be the reason for
my problems. I would be grateful for any advice on this matter.
David