Database is so "Heavy"

  • Follow


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 =3D=3D> 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=E9.

0
Reply gatarossi 9/18/2007 10:09:30 AM

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. 


-- 
Wayne
Manchester, England.



"gatarossi@ig.com.br" wrote:

> 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é.
> 
> 
0
Reply Utf 9/18/2007 10:24:01 AM

Just note that you cannot do this to the database in which the code is 
running.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message 
news:DF76F2EF-E72E-4F17-93A4-521590091C24@microsoft.com...
> 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.
>
>
> -- 
> Wayne
> Manchester, England.
>
>
>
> "gatarossi@ig.com.br" wrote:
>
>> 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´┐Ż.
>>
>> 


0
Reply Douglas 9/18/2007 11:21:05 AM

On Tue, 18 Sep 2007 03:09:30 -0700, gatarossi@ig.com.br wrote:

>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]
0
Reply John 9/18/2007 6:35:02 PM

hi
How I can solution this problem plz
thanks
"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message 
news:de60f3ldusse58e7ojv1aqo7o12e07elfn@4ax.com...
> On Tue, 18 Sep 2007 03:09:30 -0700, gatarossi@ig.com.br wrote:
>
>>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] 


0
Reply sora 9/20/2007 7:14:08 AM

4 Replies
197 Views

(page loaded in 1.215 seconds)


Reply: