Recordset Bloating

D

DS

I heard or saw a rumour that everytime you open a recordset it bloats
your database is this true?

Private Sub List52_AfterUpdate()
Me.RecordsetClone.FindFirst "[LineId] = " & Me![List52].Column(0) & "
And [ItemID] = " & Me![List52].Column(1) & ""
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

For instance, the above statement,would that cause bloating. If so how
do you fix it, or stop the bloating?

Thanks
DS
 
A

Albert D.Kallal

Generally, that "rule" applies to reocrdsets that YOU open.

In your example below, you don't open the reocrdset, so you don't have to
close it, and it would not make sense to try and close the forms reocrdset
anyway.

So, if YOU in code CREATE AND OPEN a reocrdset, then you should close it.

As far as I can see, you are using a existing reocrdset, so, no, you did not
create a reocreset, and htus don't have to close, or destroy it.
 
D

DS

Albert said:
Generally, that "rule" applies to reocrdsets that YOU open.

In your example below, you don't open the reocrdset, so you don't have to
close it, and it would not make sense to try and close the forms reocrdset
anyway.

So, if YOU in code CREATE AND OPEN a reocrdset, then you should close it.

As far as I can see, you are using a existing reocrdset, so, no, you did not
create a reocreset, and htus don't have to close, or destroy it.
Thank you, Albert
The size is now 11,472 KB, without any records to speak of. Is that Big?
Once again, Thank You
DS
 
J

John Vinson

For instance, the above statement,would that cause bloating. If so how
do you fix it, or stop the bloating?

Try it and see. Compact your database (Tools... Database Utilities...
Compact and Repair); close it, note the size; run this query a hundred
times in a loop; see if the database has bloated. Then compact again
(if it has).

My guess is that it won't, but I can't swear to it!

John W. Vinson[MVP]
 
A

Albert D.Kallal

Thank you, Albert
The size is now 11,472 KB, without any records to speak of. Is that Big?
Once again, Thank You

Hum, no, not really. "big" tends to be a relative term. However, what is the
size *after* a compact and repair?

Further, since you likely "split" the application, then again the file tends
to be smaller, since you then wind up with two files, and one is a data only
file.

I as a rule don't consider an application file very large at your 11 meg
size. Even 50 megs is rather small.

I got an application right now with 160 forms, 27,000 lines of code, 77
reports, and it is only 6 megs in size as a mde.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top