Database is so "Heavy"

  • Thread starter Thread starter gatarossi
  • Start date Start date
G

gatarossi

Dear all,

In my access database, I need to do a lot of consults, to exclude and
to include data in the tables. Then the database stay so "heavy".

I know that I can access Tools ==> compact and repair database, then
the database stay with your correct measured.

Is there any way to do this in vba code?

Thanks a lot!!!

André.
 
Hi

You could do this from an OnClick - something like


Private Sub ButtonName_Click()
Dim strDBtoBackUp As String
strDBtoBackUp = "C:\Documents and Settings\My Documents\DBName.mdb"
DBEngine.CompactDatabase strDBtoBackUp
End Sub


change the path to what it is.
 
Just note that you cannot do this to the database in which the code is
running.
 
In my access database, I need to do a lot of consults, to exclude and
to include data in the tables. Then the database stay so "heavy".

Do you have a large number of queries ("consults" is not a good translation!)
because you have different criteria in each query? If so, consider using
Parameter Queries. Rather than a query "qryJune" with criteria

BETWEEN #6/1/2007# AND #6/30/2007#

and similar queries for July, August and so on, you can use ONE query with a
criterion

BETWEEN [Forms]![FormName]![txtStart] AND [Forms]![FormName]![txtEnd]

and similarly for many other queries.

John W. Vinson [MVP]
 
hi
How I can solution this problem plz
thanks
John W. Vinson said:
In my access database, I need to do a lot of consults, to exclude and
to include data in the tables. Then the database stay so "heavy".

Do you have a large number of queries ("consults" is not a good
translation!)
because you have different criteria in each query? If so, consider using
Parameter Queries. Rather than a query "qryJune" with criteria

BETWEEN #6/1/2007# AND #6/30/2007#

and similar queries for July, August and so on, you can use ONE query with
a
criterion

BETWEEN [Forms]![FormName]![txtStart] AND [Forms]![FormName]![txtEnd]

and similarly for many other queries.

John W. Vinson [MVP]
 
hi
How I can solution this problem plz

Please explain the problem in a way that someone can understand it.

You have a lot of queries. Do you want to reduce the number of queries? Do you
want to automatically compact the database? What IS the problem?

John W. Vinson [MVP]
 

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

Back
Top