Hi,
no worries!
It's straightforward file permissions and not via an MDW file. The backend
database file itself is set as read only access for some users, and full
access for others (via properties>security menu in explorer). What I want to
do is keep these permissions, but the code to compact and repair always
creates a new version of the backend file which then inherits permissions
from the parent folder that the .mdb file is in.
Marc
"Argyronet" wrote:
> Hi,
>
> I do not understand your problem
|
> Do you speak about MDW file ?
>
> --
> Argy
> Goto : http://argyronet.developpez.com/
> Livres :
> Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
> VBA pour Office 2007 (ISBN 2742983910)
>
>
>
> "Marc T" wrote:
>
> > hi all,
> >
> > here's a poser that has got me stumped....
> >
> > I use the following code to compact/repair a database backend:
> >
> > Private Sub Form_Unload(Cancel As Integer)
> >
> > Dim strBackupBackend As String
> > Dim strCurrBackend As String
> > Dim strCurrLockFile As String
> >
> > strCurrBackend = CurrentProject.Path & "\Data\" &
> > Left(CurrentProject.Name, Len(CurrentProject.Name) - 4) & "_be.mdb"
> > strCurrLockFile = CurrentProject.Path & "\Data\" &
> > Left(CurrentProject.Name, Len(CurrentProject.Name) - 4) & "_be.ldb"
> > strBackupBackend = CurrentProject.Path & "\Data\" &
> > Left(CurrentProject.Name, Len(CurrentProject.Name) - 4) & "_be.bak"
> >
> > If Len(Dir(strCurrLockFile)) > 0 Then
> > MsgBox strCurrBackend & " is still in use. " & _
> > "It cannot be compacted."
> > Else
> > If Len(Dir(strBackupBackend)) > 0 Then
> > Kill strBackupBackend
> > End If
> > Name strCurrBackend As strBackupBackend
> > DBEngine.CompactDatabase strBackupBackend, strCurrBackend
> > End If
> >
> > End Sub
> >
> >
> >
> > It works a treat, but now I'd like to set file permissions for the backend
> > database.... problem is, the code above creates a new version of the backend
> > prior to compacting which inherits permissions from the directory it is sat
> > in wiping out the permissions I've set. Does anyone have any ideas on how to
> > force the backend to keep the permissions I have set?
> >
> > Cheers as ever!
> > Marc
> >