L
lappy
Hello, I have written a small programme to compact an access 97
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 tried running the code on a number of different databases and
it works fine. The code as been run in debug mode and as an exe file
without any problems. I then ran the code on another database but it
does not complete and errors up with: 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.
Does anybody know why. Is it possibly to do with security. If I
Compact the database from Access manually it works fine. If I use code
in access and run the code from a makro, when the database with the
code in it opens, it also works successfully. The above code works on
all other databases. I have a feeling that there is some security
issue can anybody shed any light on this problem? Thanks.
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 tried running the code on a number of different databases and
it works fine. The code as been run in debug mode and as an exe file
without any problems. I then ran the code on another database but it
does not complete and errors up with: 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.
Does anybody know why. Is it possibly to do with security. If I
Compact the database from Access manually it works fine. If I use code
in access and run the code from a makro, when the database with the
code in it opens, it also works successfully. The above code works on
all other databases. I have a feeling that there is some security
issue can anybody shed any light on this problem? Thanks.