PC Review


Reply
Thread Tools Rate Thread

Compact database thru VBA

 
 
Ron Carr
Guest
Posts: n/a
 
      10th Jun 2009
From what I have read, I can't compress my back-end DB from the front-end
because the back-end would be open(wouldn't it open as soon as the front-end
linked to it?).

The solution I see is to set up another database to do nothing but run the
compact, then have it start up my front-end.
The thinking is to hide as much as possible from the user.
Does this approach make sense or is there a better way?
(Access 2003)
Thanks for your thoughts!
Ron
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      10th Jun 2009
No, the back-end won't be open until you actually need data from it. Make
sure that all of your bound forms are closed, and you should see that the
locking file (.ldb) is deleted: that's the cue that it's no longer open.

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


"Ron Carr" <(E-Mail Removed)> wrote in message
news:894D3AF1-3C76-4643-A410-(E-Mail Removed)...
> From what I have read, I can't compress my back-end DB from the front-end
> because the back-end would be open(wouldn't it open as soon as the
> front-end
> linked to it?).
>
> The solution I see is to set up another database to do nothing but run the
> compact, then have it start up my front-end.
> The thinking is to hide as much as possible from the user.
> Does this approach make sense or is there a better way?
> (Access 2003)
> Thanks for your thoughts!
> Ron



 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      10th Jun 2009
"Ron Carr" <(E-Mail Removed)> wrote in message
news:894D3AF1-3C76-4643-A410-(E-Mail Removed)...
> From what I have read, I can't compress my back-end DB from the front-end
> because the back-end would be open(wouldn't it open as soon as the
> front-end
> linked to it?).


No, the back-end is only opened when one of the linked tables is accessed,
as by an open form, query, recordset, or table datasheet. You can compact
the back-end from the front-end, so long as you close all open connections
to it. That is, you have to close all objects that connect to the back
end -- bound forms, for the most part.

If you have multiple users connecting to the back-end, though, that's more
problematic -- you can close your own front-end's connections, but but not
those of other users.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      11th Jun 2009
> you can close your own front-end's connections, but but not
> those of other users.


I thought there was a way to do this utilizing the timer on a form and
checking against an entered value in a table. I forget the code to actually
force the user off (haven't tried it before), but I thought I've come across
a few solutions to designate a specified time to force all user off for
backend maintanence.

Not necessarily from your particular frontend maybe, but I think it is
possible from a development standpoint.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"Dirk Goldgar" wrote:

> "Ron Carr" <(E-Mail Removed)> wrote in message
> news:894D3AF1-3C76-4643-A410-(E-Mail Removed)...
> > From what I have read, I can't compress my back-end DB from the front-end
> > because the back-end would be open(wouldn't it open as soon as the
> > front-end
> > linked to it?).

>
> No, the back-end is only opened when one of the linked tables is accessed,
> as by an open form, query, recordset, or table datasheet. You can compact
> the back-end from the front-end, so long as you close all open connections
> to it. That is, you have to close all objects that connect to the back
> end -- bound forms, for the most part.
>
> If you have multiple users connecting to the back-end, though, that's more
> problematic -- you can close your own front-end's connections, but but not
> those of other users.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>

 
Reply With Quote
 
Ron Carr
Guest
Posts: n/a
 
      11th Jun 2009
Thanks, that takes care of the problem.
Ron

"Douglas J. Steele" wrote:

> No, the back-end won't be open until you actually need data from it. Make
> sure that all of your bound forms are closed, and you should see that the
> locking file (.ldb) is deleted: that's the cue that it's no longer open.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Ron Carr" <(E-Mail Removed)> wrote in message
> news:894D3AF1-3C76-4643-A410-(E-Mail Removed)...
> > From what I have read, I can't compress my back-end DB from the front-end
> > because the back-end would be open(wouldn't it open as soon as the
> > front-end
> > linked to it?).
> >
> > The solution I see is to set up another database to do nothing but run the
> > compact, then have it start up my front-end.
> > The thinking is to hide as much as possible from the user.
> > Does this approach make sense or is there a better way?
> > (Access 2003)
> > Thanks for your thoughts!
> > Ron

>
>
>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      11th Jun 2009
"Jack Leach" <dymondjack at hot mail dot com> wrote in message
news:C0463A55-07EA-417E-BBE9-(E-Mail Removed)...
>> you can close your own front-end's connections, but but not
>> those of other users.

>
> I thought there was a way to do this utilizing the timer on a form and
> checking against an entered value in a table. I forget the code to
> actually
> force the user off (haven't tried it before), but I thought I've come
> across
> a few solutions to designate a specified time to force all user off for
> backend maintanence.
>
> Not necessarily from your particular frontend maybe, but I think it is
> possible from a development standpoint.


Yes, you can do that quite easily if you design the application that way. I
wasn't considering that level of re-architecting.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      15th Jun 2009
"Dirk Goldgar" <(E-Mail Removed)> wrote:

>No, the back-end is only opened when one of the linked tables is accessed,
>as by an open form, query, recordset, or table datasheet.


It would be more precise to say an open bound form must be closed.
Also an unbound form with a combo or list box bound to a row source.
Also an open recordset or database variable such as those used for
performance persistent connections.

>You can compact
>the back-end from the front-end, so long as you close all open connections
>to it. That is, you have to close all objects that connect to the back
>end -- bound forms, for the most part.


Also reports if the user has left any open.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Granite Fleet Manager http://www.granitefleet.com/
 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      15th Jun 2009
"Tony Toews [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Dirk Goldgar" <(E-Mail Removed)> wrote:
>
>>No, the back-end is only opened when one of the linked tables is accessed,
>>as by an open form, query, recordset, or table datasheet.

>
> It would be more precise to say an open bound form must be closed.
> Also an unbound form with a combo or list box bound to a row source.
> Also an open recordset or database variable such as those used for
> performance persistent connections.


Yes, of course. I didn't think it was necessary to list all examples.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      16th Jun 2009
"Dirk Goldgar" <(E-Mail Removed)> wrote:

>>>No, the back-end is only opened when one of the linked tables is accessed,
>>>as by an open form, query, recordset, or table datasheet.

>>
>> It would be more precise to say an open bound form must be closed.
>> Also an unbound form with a combo or list box bound to a row source.
>> Also an open recordset or database variable such as those used for
>> performance persistent connections.

>
>Yes, of course. I didn't think it was necessary to list all examples.


Yeah, I know I'm a bit nit picky but the combo box on an unbound form
actually caused someone some grief a few weeks or a month ago.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Granite Fleet Manager http://www.granitefleet.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compact and Repair a database from a macro in a different database DDogCap Microsoft Access 3 3rd Aug 2008 04:41 AM
Database woes in compact framework. Attempting to add contents oflistview to database. Loogie Microsoft Dot NET Compact Framework 1 7th May 2007 07:14 PM
Compact or Copy a linked database to a new database Greg J Microsoft Access 3 5th May 2006 07:17 AM
Provide database password to automatically compact database =?Utf-8?B?VHJhbiBIb25nIFF1YW5n?= Microsoft Access VBA Modules 0 14th Feb 2006 09:09 PM
Marco - Database Utilties-Compact and Repair Database =?Utf-8?B?RGFubnk=?= Microsoft Access Macros 0 18th Apr 2005 10:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:03 AM.