What I'm trying to do is compacting a access 2007 database with an excel macro. However my problem is that database is password protected and it asked for password as in prompt a password box and when i enter it and it compacts the database.Somehow i'm not able to figure out how to embed this password in the code itself. Can anyone help me in the same. Enclosed is the code.
Also i tried jet method but it won't work since i'm dealing with 2007 and it gives me an error message in that which is class not registered.
Dim x As New Access.Application
x.CompactRepair "c:\COD\ABC.accdb", "C:\COD\abc1.accdb"
Name "C:\COD\abc1.accdb" As "C:\COD\abc.accdb"