vb6 compact access database under vista

Posted on 2007-10-19
Last Modified: 2012-06-27

This VB6 code is used under windows XP but doesn't function under Vista :

Dim JRO As JRO.JetEngine
Set JRO = New JRO.JetEngine

NomBaseOrigine = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Base1.mdb;Jet OLEDB:Database Password=password"
NomBaseDestination = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Base2.mdb;Jet OLEDB:Engine Type=4;Jet OLEDB:Database Password=password"
JRO.CompactDatabase NomBaseOrigine, NomBaseDestination
fs.deletefile "C:\Base1.mdb", True
Name  "C:\Base2.mdb" As  "C:\Base1.mdb"

Is it possible to have a VB6 code to compact an access 97 database ?

Thanks in advance
Question by:lugos01
    LVL 14

    Accepted Solution

    What I would do is use Tools, Macros, Record a new Macro, and step through the process.  The code generated should work.  

    Author Comment

    Thanks for your answer.

    Does it function if Ms Access is not installed on the computer ?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now