Results 1 to 4 of 4

Thread: Compacting DataBase

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Romania
    Posts
    81

    Wink Compacting DataBase

    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.
    ...

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    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:
    1. 'In the Visual Basic IDE, On the Projects menu, click References.
    2. 'Add Microsoft Jet And Replication Objects X.X library, where (X.X Is greater than Or equal To 2.1).
    3.  
    4.  
    5. 'Add the following lines of code To Visual Basic, replacing the data source And destination database paths If needed:
    6.  
    7.  
    8. Dim jro As jro.JetEngine
    9. Set jro = New jro.JetEngine
    10. jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\nwind2.mdb", _
    11. "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\abbc2.mdb;Jet OLEDB:Engine Type=4"
    -= a peet post =-

  3. #3
    Addicted Member
    Join Date
    Mar 2002
    Posts
    135

    Problem Compacting Password Protected Database

    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

  4. #4
    Hyperactive Member Ed Lampman's Avatar
    Join Date
    Mar 2001
    Posts
    273
    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.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width