Have created small programme to compact a database:
Dim je As New JRO.JetEngine
' Compacts database Data.Mdb to Data2.mdb.
je.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=C:\Dump\DataOld.Mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=C:\Dump\Data.Mdb"
I have compacted a number of databases with this little programme and
it works fine. The problem is I have one database that it will not
compact and get the error: "You do not have the necessary permissions
to use the '' object. Have your system administrator or the person
who created this object establish the appropriate permissions for
you."
If this database is compacted manually through the
Access-tools-database utilities-compact database it compacts fine
without a problem. If I create another database with some access code
in a module then run a makro when I open this database to compact it,
there is no problem and the database compacts fine. Can the problem be
because of some security issue. Do I need to establish some sort of
connection before doing so? Can anybody shed any light on this matter.
Veign - 30 Sep 2004 18:01 GMT
[multiposted]

Signature
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
--
> Have created small programme to compact a database:
> Dim je As New JRO.JetEngine
[quoted text clipped - 18 lines]
> because of some security issue. Do I need to establish some sort of
> connection before doing so? Can anybody shed any light on this matter.