Compact Access Database into itself 
Author Message
 Compact Access Database into itself

Hi,
    Is it possible to compact an access database into itself?  The problem I
am having is when the database is
on a Novell server and the program compacts the database, I lose the Novell
attributes.

Thanks

Tim



Sat, 05 Mar 2005 20:05:00 GMT  
 Compact Access Database into itself

Hi,
    Is it possible to compact an access database into itself?  The problem I
am having is when the database is
on a Novell server and the program compacts the database, I lose the Novell
attributes.

You might be able to use Access automation with DoCmd and DoMenuItem but I'm not aware of any way to
do it with CompactDatabase.


Microsoft MVP (Visual Basic)



Sat, 05 Mar 2005 22:09:04 GMT  
 Compact Access Database into itself
With the long history of problems with Access databases residing on Novell servers that I have seenm I'd say this is the first time I have ever heard this one
<G> Unfortunately, No you cannot compact an Access database to itself. You have to compact it to another file then rename it. IS there any way to set the
Attributes from code might be a better question.

Check out the File System Objects Attributes property

This code is from there and may give you an idea

Sub SetClearArchiveBit(filespec)
    Dim fs, f, r
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(fs.GetFileName(filespec))
    If f.attributes and 32 Then
        r = MsgBox("The Archive bit is set, do you want to clear it?", vbYesNo, "Set/Clear Archive Bit")
        If r = vbYes Then
            f.attributes = f.attributes - 32
            MsgBox "Archive bit is cleared."
        Else
            MsgBox "Archive bit remains set."
        End If
    Else
        r = MsgBox("The Archive bit is not set. Do you want to set it?", vbYesNo, "Set/Clear Archive Bit")
        If r = vbYes Then
            f.attributes = f.attributes + 32
            MsgBox "Archive bit is set."
        Else
            MsgBox "Archive bit remains clear."
        End If
    End If
End Sub

Scot Rose, MCSD
Microsoft Visual Basic Developer Support

Want to know more? Check out the MSDN at msdn.microsoft.com or the Microsoft Knowledge Base at support.microsoft.com

This posting is provided AS IS, with no warranties, and confers no rights.

--------------------

Quote:

>Subject: Compact Access Database into itself
>Date: Tue, 17 Sep 2002 07:05:00 -0500
>Lines: 11
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300

>Newsgroups: microsoft.public.vb.database.ado
>NNTP-Posting-Host: 64.254.222.42
>Path: cpmsftngxa08!tkmsftngp01!tkmsftngp09
>Xref: cpmsftngxa08 microsoft.public.vb.database.ado:75047
>X-Tomcat-NG: microsoft.public.vb.database.ado

>Hi,
>    Is it possible to compact an access database into itself?  The problem I
>am having is when the database is
>on a Novell server and the program compacts the database, I lose the Novell
>attributes.

>Thanks

>Tim



Sun, 06 Mar 2005 00:58:14 GMT  
 Compact Access Database into itself
I had this same problem... and this is the fix!!!

Put database in a specific folder for it's own use.
Then...
Have your Novell server administrator set the attributes properties on that
*parent* folder, and set it so that is always propagates the folder's rights
to any file created in that folder.  Done deal...

Now when you compact/repair, the new file will automatically receive the
same attributes.

Simple solution for a
pain-in-the-butt-cost-me-many-days-of-headache-problem.
[:-)
HTH.

~Duane.


Quote:
> Hi,
>     Is it possible to compact an access database into itself?  The problem
I
> am having is when the database is
> on a Novell server and the program compacts the database, I lose the
Novell
> attributes.

> Thanks

> Tim



Sun, 06 Mar 2005 02:50:19 GMT  
 Compact Access Database into itself
After going back and reading my post, I felt that a little more information
here might be prudent...
When you compact the database from within the Access shell, it may *appear*
that it compacted into itself.  But what really happens is that MS Access
compacts to a new temp file such as "db1.mdb".  Then if the compact
succeeds, it deletes the old file and renames the new one to the name of the
old one.

This is why you experience what you say... the Novell server just received a
new file, so it assigns permissions based on your Administrators settings.

Network guys may give permissions to User Groups by file, not directory.
Hope this is helps

~Duane.


Quote:
> I had this same problem... and this is the fix!!!

> Put database in a specific folder for it's own use.
> Then...
> Have your Novell server administrator set the attributes properties on
that
> *parent* folder, and set it so that is always propagates the folder's
rights
> to any file created in that folder.  Done deal...

> Now when you compact/repair, the new file will automatically receive the
> same attributes.

> Simple solution for a
> pain-in-the-butt-cost-me-many-days-of-headache-problem.
> [:-)
> HTH.

> ~Duane.



> > Hi,
> >     Is it possible to compact an access database into itself?  The
problem
> I
> > am having is when the database is
> > on a Novell server and the program compacts the database, I lose the
> Novell
> > attributes.

> > Thanks

> > Tim



Sat, 12 Mar 2005 07:30:14 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Can an access application compact itself?

2. Repairing/compacting a Access-Database without Access or DAO

3. Compacting Access 97 Database

4. Repare/Compact database in Access 2000

5. Compact Access database incode.

6. My database Access 97 hangs up under Windows 98 after compacting

7. Compacting multiple Access 7.0 databases

8. Compacting multiple Access 7.0 database files

9. Help! Compacting Decompiles an Access 97 Database

10. Compact an MS Access 97 Database File Through VB6

11. Compact Access 2000 Database

12. Compact/Repair Access 2000 database

 

 
Powered by phpBB® Forum Software