By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,828 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Compact on Close Code

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.