473,467 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code For Compact On Close?

I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution, where I
can just call the compact function as the database is closing (I'm guessing
this isn't possible...).

Thanks.
Oct 28 '07 #1
29 2741
Hi

Someone gave me this function:

Public Function AutoCompactApplication()

Dim s
Dim strProjectPath As String, strProjectName As String

strProjectPath = Application.CurrentProject.Path
strProjectName = Application.CurrentProject.Name
filespec = strProjectPath & "\" & strProjectName

s = CLng(FileLen(filespec) / 1000000) 'convert size

If s 20 Then 'edit the 20 (Mb's) to the max size you want to allow
your app to grow.

Application.SetOption ("Auto Compact"), 1 'compact app

Else

Application.SetOption ("Auto Compact"), 0 'no don't compact app

End If

End Function

Call the function when your DB closes down.
Neil wrote:
>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution, where I
can just call the compact function as the database is closing (I'm guessing
this isn't possible...).

Thanks.
--
Message posted via http://www.accessmonster.com

Oct 28 '07 #2
suggest you declare the variable "s" as a Long data type, as

Dim s As Long

leaving it undeclared means it is the default data type Variant, which is
less effecient.

hth
"biganthony via AccessMonster.com" <u31673@uwewrote in message
news:7a5ae5bec164f@uwe...
Hi

Someone gave me this function:

Public Function AutoCompactApplication()

Dim s
Dim strProjectPath As String, strProjectName As String

strProjectPath = Application.CurrentProject.Path
strProjectName = Application.CurrentProject.Name
filespec = strProjectPath & "\" & strProjectName

s = CLng(FileLen(filespec) / 1000000) 'convert size

If s 20 Then 'edit the 20 (Mb's) to the max size you want to allow
your app to grow.

Application.SetOption ("Auto Compact"), 1 'compact app

Else

Application.SetOption ("Auto Compact"), 0 'no don't compact app

End If

End Function

Call the function when your DB closes down.
Neil wrote:
I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution,
where I
can just call the compact function as the database is closing (I'm
guessing
this isn't possible...).

Thanks.

--
Message posted via http://www.accessmonster.com

Oct 28 '07 #3
answered in comp.databases.ms-access.
"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution, where
I
can just call the compact function as the database is closing (I'm
guessing
this isn't possible...).

Thanks.


Oct 28 '07 #4
Thanks.

I wonder why not just use currentdb.name for filespec?
"biganthony via AccessMonster.com" <u31673@uwewrote in message
news:7a5ae5bec164f@uwe...
Hi

Someone gave me this function:

Public Function AutoCompactApplication()

Dim s
Dim strProjectPath As String, strProjectName As String

strProjectPath = Application.CurrentProject.Path
strProjectName = Application.CurrentProject.Name
filespec = strProjectPath & "\" & strProjectName

s = CLng(FileLen(filespec) / 1000000) 'convert size

If s 20 Then 'edit the 20 (Mb's) to the max size you want to allow
your app to grow.

Application.SetOption ("Auto Compact"), 1 'compact app

Else

Application.SetOption ("Auto Compact"), 0 'no don't compact app

End If

End Function

Call the function when your DB closes down.
Neil wrote:
>>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution, where
I
can just call the compact function as the database is closing (I'm
guessing
this isn't possible...).

Thanks.

--
Message posted via http://www.accessmonster.com

Oct 28 '07 #5
To set the Compact on Close option, you must deal with menu options, but you
can use the following to compact during the close event of the last form
open.

http://www.mvps.org/access/general/gen0041.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size and then perform the compact through code as the mdb's closing. Is
that possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution, where
I can just call the compact function as the database is closing (I'm
guessing this isn't possible...).

Thanks.

Oct 28 '07 #6
Thanks! That's good to know. I'd never seen the menu bars accessed that way,
so that's good to know too. (And a very creative use of the line break
character as well! :-) ) Thanks!

"Arvin Meyer [MVP]" <a@m.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
To set the Compact on Close option, you must deal with menu options, but
you can use the following to compact during the close event of the last
form open.

http://www.mvps.org/access/general/gen0041.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
>>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size and then perform the compact through code as the mdb's closing. Is
that possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution,
where I can just call the compact function as the database is closing
(I'm guessing this isn't possible...).

Thanks.


Oct 29 '07 #7
Thanks again, Arvin. Now I need one for setting the Break On Unhandled
Errors option in VBA Tools | Options? Do you know of anything? Thanks!

Neil
"Arvin Meyer [MVP]" <a@m.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
To set the Compact on Close option, you must deal with menu options, but
you can use the following to compact during the close event of the last
form open.

http://www.mvps.org/access/general/gen0041.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
>>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size and then perform the compact through code as the mdb's closing. Is
that possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution,
where I can just call the compact function as the database is closing
(I'm guessing this isn't possible...).

Thanks.


Nov 1 '07 #8
answered in thread "Code for Break on Unhandled Errors", dated 10/31/07, in
this newsgroup.
"Neil" <no****@nospam.netwrote in message
news:p7*******************@newssvr14.news.prodigy. net...
Thanks again, Arvin. Now I need one for setting the Break On Unhandled
Errors option in VBA Tools | Options? Do you know of anything? Thanks!

Neil
"Arvin Meyer [MVP]" <a@m.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
To set the Compact on Close option, you must deal with menu options, but
you can use the following to compact during the close event of the last
form open.

http://www.mvps.org/access/general/gen0041.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size and then perform the compact through code as the mdb's closing. Is
that possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database
is
opened. That would probably work. But I'd prefer a cleaner solution,
where I can just call the compact function as the database is closing
(I'm guessing this isn't possible...).

Thanks.


Nov 1 '07 #9
If only I'd waited another hour!... Thanks for your reply there (and here!).

"tina" <no****@address.comwrote in message
news:dw*******************@bgtnsc05-news.ops.worldnet.att.net...
answered in thread "Code for Break on Unhandled Errors", dated 10/31/07,
in
this newsgroup.
"Neil" <no****@nospam.netwrote in message
news:p7*******************@newssvr14.news.prodigy. net...
>Thanks again, Arvin. Now I need one for setting the Break On Unhandled
Errors option in VBA Tools | Options? Do you know of anything? Thanks!

Neil
"Arvin Meyer [MVP]" <a@m.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
To set the Compact on Close option, you must deal with menu options,
but
you can use the following to compact during the close event of the last
form open.

http://www.mvps.org/access/general/gen0041.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size and then perform the compact through code as the mdb's closing. Is
that possible?

I suppose one option would be to set the Compact On Close option in
the
switchboard's On Close event, and then clear it whenever the database
is
>opened. That would probably work. But I'd prefer a cleaner solution,
where I can just call the compact function as the database is closing
(I'm guessing this isn't possible...).

Thanks.



Nov 1 '07 #10
you're welcome. and btw, my previous post was not a scolding of any kind; i
posted it for the benefit of others who might read this thread.
"Neil" <no****@nospam.netwrote in message
news:Ue****************@nlpi061.nbdc.sbc.com...
If only I'd waited another hour!... Thanks for your reply there (and
here!).
>
"tina" <no****@address.comwrote in message
news:dw*******************@bgtnsc05-news.ops.worldnet.att.net...
answered in thread "Code for Break on Unhandled Errors", dated 10/31/07,
in
this newsgroup.
"Neil" <no****@nospam.netwrote in message
news:p7*******************@newssvr14.news.prodigy. net...
Thanks again, Arvin. Now I need one for setting the Break On Unhandled
Errors option in VBA Tools | Options? Do you know of anything? Thanks!

Neil
"Arvin Meyer [MVP]" <a@m.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
To set the Compact on Close option, you must deal with menu options,
but
you can use the following to compact during the close event of the
last
form open.

http://www.mvps.org/access/general/gen0041.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Neil" <no****@nospam.netwrote in message
news:PZ****************@newssvr25.news.prodigy.net ...
I would like to compact on close only if the database size goes over
a
>certain amount, rather than each time. Thus, I'd like to check the
file
>size and then perform the compact through code as the mdb's closing.
Is
>that possible?

I suppose one option would be to set the Compact On Close option in
the
switchboard's On Close event, and then clear it whenever the
database
is
opened. That would probably work. But I'd prefer a cleaner solution,
where I can just call the compact function as the database is
closing
(I'm guessing this isn't possible...).

Thanks.






Nov 2 '07 #11
On Oct 28, 12:11 am, "Neil" <nos...@nospam.netwrote:
I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution, where I
can just call the compact function as the database is closing (I'm guessing
this isn't possible...).
Perhaps, for beginners it's worthwhile ot point out why (IMO) this
capability (check size and if big, compact) isn't built in to Access.
Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there. So the front-end will need compacting no more often than the
user has some spare time and says, "Gee, maybe I should compact this
thing." The back end can be compacted regularly; we only have to
ascertain that no one has opened it exclusivley before we do so; this
can be built into code rather easily.
Nov 2 '07 #12
I completely disagree with you. One of the advantages of using an Access MDB
file over, say, an ADP, is the ability to use temporary tables for report
generation and other ad-hoc uses.

Also, some implementations of client-server apps using an MDB front end will
copy static lookup tables from the server machine when the database is
opened, and then use those local tables for lookup, instead of making calls
across the network for lookup tables.

So I disagree that "a well designed front-end will not grow in size."
"lyle" <ly************@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
On Oct 28, 12:11 am, "Neil" <nos...@nospam.netwrote:
>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution,
where I
can just call the compact function as the database is closing (I'm
guessing
this isn't possible...).

Perhaps, for beginners it's worthwhile ot point out why (IMO) this
capability (check size and if big, compact) isn't built in to Access.
Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there. So the front-end will need compacting no more often than the
user has some spare time and says, "Gee, maybe I should compact this
thing." The back end can be compacted regularly; we only have to
ascertain that no one has opened it exclusivley before we do so; this
can be built into code rather easily.


Nov 3 '07 #13
If you're using temporary tables in an MDB, you should put them in a
temporary database so that the front-end doesn't increase significantly in
size.

See the example Tony Toews has at
http://www.granite.ab.ca/access/temptables.htm

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Neil" <no****@nospam.netwrote in message
news:hY*****************@nlpi068.nbdc.sbc.com...
>I completely disagree with you. One of the advantages of using an Access
MDB file over, say, an ADP, is the ability to use temporary tables for
report generation and other ad-hoc uses.

Also, some implementations of client-server apps using an MDB front end
will copy static lookup tables from the server machine when the database
is opened, and then use those local tables for lookup, instead of making
calls across the network for lookup tables.

So I disagree that "a well designed front-end will not grow in size."
"lyle" <ly************@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...
>On Oct 28, 12:11 am, "Neil" <nos...@nospam.netwrote:
>>I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database is
opened. That would probably work. But I'd prefer a cleaner solution,
where I
can just call the compact function as the database is closing (I'm
guessing
this isn't possible...).

Perhaps, for beginners it's worthwhile ot point out why (IMO) this
capability (check size and if big, compact) isn't built in to Access.
Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there. So the front-end will need compacting no more often than the
user has some spare time and says, "Gee, maybe I should compact this
thing." The back end can be compacted regularly; we only have to
ascertain that no one has opened it exclusivley before we do so; this
can be built into code rather easily.



Nov 3 '07 #14
lyle <ly************@gmail.comwrote:
>Most enterprise Access applications are built on the front-end, back-
end model.
I would say all but there are a few idiots out there.
>I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there.
It's been my experience that the FE will grow by about 10% or 20% in the first few
days and thereafter stay the same size roughly. I've had clients who haven't
replaced or compacted the FE for a year or two.

Tony

--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Nov 3 '07 #15
"Neil" <no****@nospam.netwrote in
news:hY*****************@nlpi068.nbdc.sbc.com:
I completely disagree with you. One of the advantages of using an
Access MDB file over, say, an ADP, is the ability to use temporary
tables for report generation and other ad-hoc uses.

Also, some implementations of client-server apps using an MDB
front end will copy static lookup tables from the server machine
when the database is opened, and then use those local tables for
lookup, instead of making calls across the network for lookup
tables.

So I disagree that "a well designed front-end will not grow in
size."
any front end that does either of the things you describe is one
that I would classify as poorly-designed.

Temporary data belongs in a temporary database, not in your front
end. Any other approach is a substandard design.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 4 '07 #16
"Tony Toews [MVP]" <tt****@telusplanet.netwrote in
news:jl********************************@4ax.com:
It's been my experience that the FE will grow by about 10% or 20%
in the first few days and thereafter stay the same size roughly.
I've had clients who haven't replaced or compacted the FE for a
year or two.
It's important, however, to compact your front end if the
proportions of the data tables in your back end change. If, for
instance, your queries in your front end are compiled when you have
1000 records in one table and 1000 records in another, and your
database grows to 2000 in one and 500,000 in the other, it's likely
that the compilation for queries using those two tables will be
sub-optimal. A compact will flag all queries for recompiling using
current table statistics the next time those queries are executed.

But it's very seldom that back end data changes so drastically in a
way that makes the original compilation plan inefficient. But it's
also important to remember that it's possible for that to happen.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 4 '07 #17
And the temporary database would still need to be compacted occasionally.
Remember, the person I was replying to wrote:
>>Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there.
In other words, his argument was that all data would be in the back end, and
there would be no data in the front end (whether in the main or a temporary
database) to grow the database. That's what I was saying was wrong.
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.comwrote in message
news:e6**************@TK2MSFTNGP03.phx.gbl...
If you're using temporary tables in an MDB, you should put them in a
temporary database so that the front-end doesn't increase significantly in
size.

See the example Tony Toews has at
http://www.granite.ab.ca/access/temptables.htm

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Neil" <no****@nospam.netwrote in message
news:hY*****************@nlpi068.nbdc.sbc.com...
>>I completely disagree with you. One of the advantages of using an Access
MDB file over, say, an ADP, is the ability to use temporary tables for
report generation and other ad-hoc uses.

Also, some implementations of client-server apps using an MDB front end
will copy static lookup tables from the server machine when the database
is opened, and then use those local tables for lookup, instead of making
calls across the network for lookup tables.

So I disagree that "a well designed front-end will not grow in size."
"lyle" <ly************@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegr oups.com...
>>On Oct 28, 12:11 am, "Neil" <nos...@nospam.netwrote:
I would like to compact on close only if the database size goes over a
certain amount, rather than each time. Thus, I'd like to check the file
size
and then perform the compact through code as the mdb's closing. Is that
possible?

I suppose one option would be to set the Compact On Close option in the
switchboard's On Close event, and then clear it whenever the database
is
opened. That would probably work. But I'd prefer a cleaner solution,
where I
can just call the compact function as the database is closing (I'm
guessing
this isn't possible...).

Perhaps, for beginners it's worthwhile ot point out why (IMO) this
capability (check size and if big, compact) isn't built in to Access.
Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there. So the front-end will need compacting no more often than the
user has some spare time and says, "Gee, maybe I should compact this
thing." The back end can be compacted regularly; we only have to
ascertain that no one has opened it exclusivley before we do so; this
can be built into code rather easily.




Nov 4 '07 #18
I would consider a temporary database (MDB file) a part of the front end,
even if not the main file. The SQL database would be the back end. So, if
you mean that temporary data should go in a separate MDB file on the client
machine, then you're agreeing with me that his argument that all data would
reside in the back end was wrong.

Whether in the main file or in a separate MDB file on the client machine,
the point I was making was that there was a need for temporary front end
(client) data in a well-designed system, and not all data would reside in
the back end.
"David W. Fenton" <XX*******@dfenton.com.invalidwrote in message
news:Xn**********************************@216.196. 97.142...
any front end that does either of the things you describe is one
that I would classify as poorly-designed.

Temporary data belongs in a temporary database, not in your front
end. Any other approach is a substandard design.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Nov 4 '07 #19
The temporary database would technically be a second back-end, not a
front-end.

And since it's a temporary table, you'd delete the temporary database when
done with the table, not worry about whether or not it needs compacting.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Neil" <no****@nospam.netwrote in message
news:vk***************@newssvr22.news.prodigy.net. ..
And the temporary database would still need to be compacted occasionally.
Remember, the person I was replying to wrote:
>>>Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there.

In other words, his argument was that all data would be in the back end,
and there would be no data in the front end (whether in the main or a
temporary database) to grow the database. That's what I was saying was
wrong.
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.comwrote in message
news:e6**************@TK2MSFTNGP03.phx.gbl...
>If you're using temporary tables in an MDB, you should put them in a
temporary database so that the front-end doesn't increase significantly
in size.

See the example Tony Toews has at
http://www.granite.ab.ca/access/temptables.htm

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Neil" <no****@nospam.netwrote in message
news:hY*****************@nlpi068.nbdc.sbc.com.. .
>>>I completely disagree with you. One of the advantages of using an Access
MDB file over, say, an ADP, is the ability to use temporary tables for
report generation and other ad-hoc uses.

Also, some implementations of client-server apps using an MDB front end
will copy static lookup tables from the server machine when the database
is opened, and then use those local tables for lookup, instead of making
calls across the network for lookup tables.

So I disagree that "a well designed front-end will not grow in size."

Nov 4 '07 #20
Well, if by that all data would be in the back end, that poster included a
temporary MDB file stored on the client's machine as part of the "back end,"
then I don't have a problem with what he wrote. But if he meant (as I
originally thought) that in a client/server situation any temporary data
would only be in the server database, then I would still disagree with him.
But you're probably right re. what he meant.
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.comwrote in message
news:e9****************@TK2MSFTNGP03.phx.gbl...
The temporary database would technically be a second back-end, not a
front-end.

And since it's a temporary table, you'd delete the temporary database when
done with the table, not worry about whether or not it needs compacting.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Neil" <no****@nospam.netwrote in message
news:vk***************@newssvr22.news.prodigy.net. ..
>And the temporary database would still need to be compacted occasionally.
Remember, the person I was replying to wrote:
>>>>Most enterprise Access applications are built on the front-end, back-
end model. I expect others might disagree, but in my experience a well
designed front-end will not grow in size, because no data is held
there, and no operations that require temporary data objects will run
there.

In other words, his argument was that all data would be in the back end,
and there would be no data in the front end (whether in the main or a
temporary database) to grow the database. That's what I was saying was
wrong.
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.comwrote in message
news:e6**************@TK2MSFTNGP03.phx.gbl...
>>If you're using temporary tables in an MDB, you should put them in a
temporary database so that the front-end doesn't increase significantly
in size.

See the example Tony Toews has at
http://www.granite.ab.ca/access/temptables.htm

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Neil" <no****@nospam.netwrote in message
news:hY*****************@nlpi068.nbdc.sbc.com. ..
I completely disagree with you. One of the advantages of using an Access
MDB file over, say, an ADP, is the ability to use temporary tables for
report generation and other ad-hoc uses.

Also, some implementations of client-server apps using an MDB front end
will copy static lookup tables from the server machine when the
database is opened, and then use those local tables for lookup, instead
of making calls across the network for lookup tables.

So I disagree that "a well designed front-end will not grow in size."


Nov 4 '07 #21
"Neil" <no****@nospam.netwrote in
news:qr***************@newssvr22.news.prodigy.net:
I would consider a temporary database (MDB file) a part of the
front end, even if not the main file. The SQL database would be
the back end. So, if you mean that temporary data should go in a
separate MDB file on the client machine, then you're agreeing with
me that his argument that all data would reside in the back end
was wrong.

Whether in the main file or in a separate MDB file on the client
machine, the point I was making was that there was a need for
temporary front end (client) data in a well-designed system, and
not all data would reside in the back end.
How is that position relevant to the issue of compacting a front
end? Keep in mind that Tony's solution creates the temp database on
the fly each time so it doesn't require compacting. Thus, even if
you count the temp database as part of your front end, there is
still never any need to compact the front end.

Which was, I thought, the issue in question, not whether or not "all
data would reside in the back end," which, so far as I can tell, no
one was really arguing in the sense that you are construing it.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 4 '07 #22
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.comwrote in
news:e9**************@TK2MSFTNGP03.phx.gbl:
The temporary database would technically be a second back-end, not
a front-end.

And since it's a temporary table, you'd delete the temporary
database when done with the table, not worry about whether or not
it needs compacting.
Tony recreates his on the fly when needed. I keep an empty template,
tmp.bak, and copy it over top of the tmp.mdb when I want to replace
it.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 4 '07 #23
Do you perform a Kill first, or do you just copy it over on top of it?
"David W. Fenton" <XX*******@dfenton.com.invalidwrote in message
news:Xn**********************************@216.196. 97.142...
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.comwrote in
news:e9**************@TK2MSFTNGP03.phx.gbl:
>The temporary database would technically be a second back-end, not
a front-end.

And since it's a temporary table, you'd delete the temporary
database when done with the table, not worry about whether or not
it needs compacting.

Tony recreates his on the fly when needed. I keep an empty template,
tmp.bak, and copy it over top of the tmp.mdb when I want to replace
it.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Nov 5 '07 #24
Well, first, I hadn't reviewed Tony's solution when I made the statement.
So, yes, you're right about that. So, with Tony's solution (and not the
fixed-temp-db solution that I was thinking of), there would be no need for
compacting.

So, to put this issue to rest, let me say once and for all: I agree with
you. OK? There is no need for compacting if you delete the temporary db and
recreate it on the fly. The only point I was making (which I thought the
person wasn't saying) was that you need temp data on the client machine,
even in a well-designed system, and you can't always use the server db for
temp data. That was the only point I was making, really.

"David W. Fenton" <XX*******@dfenton.com.invalidwrote in message
news:Xn**********************************@216.196. 97.142...
"Neil" <no****@nospam.netwrote in
news:qr***************@newssvr22.news.prodigy.net:
>I would consider a temporary database (MDB file) a part of the
front end, even if not the main file. The SQL database would be
the back end. So, if you mean that temporary data should go in a
separate MDB file on the client machine, then you're agreeing with
me that his argument that all data would reside in the back end
was wrong.

Whether in the main file or in a separate MDB file on the client
machine, the point I was making was that there was a need for
temporary front end (client) data in a well-designed system, and
not all data would reside in the back end.

How is that position relevant to the issue of compacting a front
end? Keep in mind that Tony's solution creates the temp database on
the fly each time so it doesn't require compacting. Thus, even if
you count the temp database as part of your front end, there is
still never any need to compact the front end.

Which was, I thought, the issue in question, not whether or not "all
data would reside in the back end," which, so far as I can tell, no
one was really arguing in the sense that you are construing it.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Nov 5 '07 #25
"Neil" <no****@nospam.netwrote in
news:H0******************@newssvr21.news.prodigy.n et:
So, to put this issue to rest, let me say once and for all: I
agree with you. OK? There is no need for compacting if you delete
the temporary db and recreate it on the fly. The only point I was
making (which I thought the person wasn't saying) was that you
need temp data on the client machine, even in a well-designed
system, and you can't always use the server db for temp data. That
was the only point I was making, really.
Well, why were you making that point? It was orthogonal to what
seems to me to be the point of discussion. Server or client has
nothing to do with it -- the main issue is whether temp data belongs
in the front end (strictly defined as the Access application).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 6 '07 #26
"Neil" <no****@nospam.netwrote in
news:H_******************@newssvr21.news.prodigy.n et:
Do you perform a Kill first, or do you just copy it over on top of
it?
In apps where I've done this, I copy over top of it in the
application close or startup. In a few cases, I've asked the user if
they want to keep their temp data between sessions. And in either
case, there's error handling in case the file is in use.

But in most of my apps, I don't do anything to it at all -- just
leave it alone, as I see no problem with letting the temp MDB bloat.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 6 '07 #27
"Neil" <no****@nospam.netwrote in
news:HZ****************@newssvr21.news.prodigy.net :
there are two distinct issues here: first the compacting
issue, and second the "all data in the back end" issue
The second one was all in your head.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Nov 6 '07 #28
OK, apparently so. Still, that's what I was discussing.

"David W. Fenton" <XX*******@dfenton.com.invalidwrote in message
news:Xn**********************************@216.196. 97.142...
"Neil" <no****@nospam.netwrote in
news:HZ****************@newssvr21.news.prodigy.net :
>there are two distinct issues here: first the compacting
issue, and second the "all data in the back end" issue

The second one was all in your head.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Nov 6 '07 #29
OK, one more time (with feeling...). I thought the person was saying that in
a well-designed system, all data, including temp data, would go in the
server db. I did not realize that by "back end" he was including a temp db
on the client machine. I thought by "back end" he meant strictly the server
db. So I was making the point that temp data would go on the client machine,
and not in the server db. That was the only point I was making.

The further discussions in this thread made the distinction between putting
the temp data in the application file on the client machine vs. in a temp
file on the client machine, and I don't disagree with that the temp file
approach is a superior method. But I thought he was saying that temp data
would go into the server db, and that was the point I was disagreeing with.
"David W. Fenton" <XX*******@dfenton.com.invalidwrote in message
news:Xn**********************************@216.196. 97.142...
"Neil" <no****@nospam.netwrote in
news:H0******************@newssvr21.news.prodigy.n et:
>So, to put this issue to rest, let me say once and for all: I
agree with you. OK? There is no need for compacting if you delete
the temporary db and recreate it on the fly. The only point I was
making (which I thought the person wasn't saying) was that you
need temp data on the client machine, even in a well-designed
system, and you can't always use the server db for temp data. That
was the only point I was making, really.

Well, why were you making that point? It was orthogonal to what
seems to me to be the point of discussion. Server or client has
nothing to do with it -- the main issue is whether temp data belongs
in the front end (strictly defined as the Access application).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Nov 6 '07 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: Mike MacSween | last post by:
Is it?
13
by: James Franklin | last post by:
Hi, I have a number of databases in A2K, written on different machines with different installations of Office. I have found that compacting a database while it is open regularly fails, seemingly...
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
3
by: Trevor Hughes | last post by:
Hello All I have a database (Access 2000, running on Win 2000), which suffers from bloat over a period of time. In order to solve the problem I set the option to compact on exit. This however...
4
by: Wayne | last post by:
Does "Compact On Close" do a "Compact and Repair" or just a compact. Is a compact necessary (or at least a good idea) on a regular basis, say weekly, for a database that has several hundred records...
1
by: robert demo via AccessMonster.com | last post by:
In my startup routine, I have the following code: s = CLng(FileLen(filespec) / 1000000) If s > 5 Then 'FIRST, BACKUP THE FRONT END If BackupFrontEnd = False Then Exit Function End If
3
by: G Gerard | last post by:
Hello The more I use an application ( an mdb) created using MSAccess I notice that the Byte size of the application keeps on increasing. Once in a while I do a Compact and Repair Database...
9
by: Ron | last post by:
New discovery. If I take a perfectly good database, and "compact/repair" on it with Access 2000 (seems to be at multiple sites--I've tried it with my system here, at another office on an...
1
by: Simon | last post by:
Dear reader, If "Compact on close" is set to yes (tickbox) the mdb or mde will be compact by closing. During this process a temporary db1.mdb will be generated and deleted after the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.