473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Compact on Close Code

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

'Now set the autocompact at close
Application.SetOption ("Auto Compact"), 1 'compact app
Else
Application.SetOption ("Auto Compact"), 0 'no don't compact app
End If

s is the size of the front end in MB. BackupFrontEnd is a function that
first backups the front end. It is working fine.

The idea is if the front end gets beyond a certain size (set to 5 MB here
for testing), the compact on close option is to be set so that when the
user closes the front end it will compact. I don't want to compact after
every close.

Here's the problem. It works fine if a user is an administrator. I can
verify that compacting occurs upon closing the front end by looking at the
status bar. If the user is part of the Users group, however, then
compacting does not occur. I have stepped through the code when logged on
as a regular user. The code definately sets the Auto Compact Option to 1. I
then double checked by typing in the Immediate Pane:

?Application.GetOption ("Auto Compact")

-1 came back as the answer, which I'm pretty sure stands for True.

Still, when closing the front end when logged on as a User and not an
Administrator, compacting does not occur because I don't see any message in
the status bar saying that compacting is or has occurred.

The code works without a problem when logged on as an administrator.

I am totally stumped and have no idea what the problem could be.

Thanks for any help.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
1 4787
Robert:

One thing you may want to check is whether the Users group has Open/Run and
Open Exclusive permissions on the database. You can check this through the
Tools/Security/User and Group Permissions option.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"robert demo via AccessMonster.com" <fo***@nospam.AccessMonster.com> wrote
in message news:ba******************************@AccessMonste r.com...
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

'Now set the autocompact at close
Application.SetOption ("Auto Compact"), 1 'compact app
Else
Application.SetOption ("Auto Compact"), 0 'no don't compact app
End If

s is the size of the front end in MB. BackupFrontEnd is a function that
first backups the front end. It is working fine.

The idea is if the front end gets beyond a certain size (set to 5 MB here
for testing), the compact on close option is to be set so that when the
user closes the front end it will compact. I don't want to compact after
every close.

Here's the problem. It works fine if a user is an administrator. I can
verify that compacting occurs upon closing the front end by looking at the
status bar. If the user is part of the Users group, however, then
compacting does not occur. I have stepped through the code when logged on
as a regular user. The code definately sets the Auto Compact Option to 1. I
then double checked by typing in the Immediate Pane:

?Application.GetOption ("Auto Compact")

-1 came back as the answer, which I'm pretty sure stands for True.

Still, when closing the front end when logged on as a User and not an
Administrator, compacting does not occur because I don't see any message in
the status bar saying that compacting is or has occurred.

The code works without a problem when logged on as an administrator.

I am totally stumped and have no idea what the problem could be.

Thanks for any help.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #2

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...
1
by: ColinWard | last post by:
Hello everyone. happy new year. I am trying to code an exit button for my application so that it automatically compacts the database when the user exits the app. Is this necessary or does the...
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...
1
by: smitty mittlebaum | last post by:
I have a strange problem that has reared its ugly head in the last few weeks. I have the option "Compact on Close" (Tools, Options, General tab) enabled on my development machine. I did this...
1
by: Mark | last post by:
Hi all, I have a Access 2002 FE/BE scenario where the BE is stored on a network drive. Due to the amount of importing/deleting, the database bloats quite a lot. UP until now, I have been booting...
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...
29
by: Neil | last post by:
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.