How do I compact a Database with a database password using ADO?
There is an example in this site, but is uses DAO, and the database does not have a database password set.
Printable View
How do I compact a Database with a database password using ADO?
There is an example in this site, but is uses DAO, and the database does not have a database password set.
Hi there
you cannot use ADO alone to compact an access db. you will have to use the Microsoft Jet And Replication Objects Library.
sample
VB Code:
'In the Visual Basic IDE, On the Projects menu, click References. 'Add Microsoft Jet And Replication Objects X.X library, where (X.X Is greater than Or equal To 2.1). 'Add the following lines of code To Visual Basic, replacing the data source And destination database paths If needed: Dim jro As jro.JetEngine Set jro = New jro.JetEngine jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\nwind2.mdb", _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\abbc2.mdb;Jet OLEDB:Engine Type=4"
Hello,
I have an access2000 Database for which I have set a password.
When I am trying to Compress the Database with the Code....
Dim JRO As New JRO.JetEngine
JRO.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\data.mdb;UID=admin;PWD=abc","Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\data.mdb;UID=admin;PWD=abc"
then I am getting an error as "Could not find Installable ISAM"
But if I try to compress without using password then it works fine.
Can u let me know what particular settings have to be done in order to compress a password protected database.
Thanks
Here's a code snippet I haven't tested. I've used this without the password, etc. It appears from this code that the password has to be passed as a property of your connection object.