Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

how can we compact and repair access db thru vb code

Sometimes the access db may be need to be repaired. How can we repair access database through visual basic code.

Please help me be sending proper code in vb.

Comments

  • archibaldarchibald Member Posts: 9
    : Sometimes the access db may be need to be repaired. How can we repair access database through visual basic code.
    :
    : Please help me be sending proper code in vb.
    :
    :

    If you are using MS Jet Engine 4.0 you can use this code:


    Dim JRO As New JRO.JetEngine

    Set JRO = New JRO.JetEngine

    JRO.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Filnamn, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Yourdatabase + ";Jet OLEDB:Engine Type=5"

    Set JRO = Nothing

    You may have to add Local Identifier in the string used in the method CompactDatabase. This in order to get the right collating sequence for your language
Sign In or Register to comment.