+ Reply to Thread
Results 1 to 2 of 2

Access Actions from Excel

  1. #1
    Registered User
    Join Date
    03-26-2004
    Posts
    35

    Access Actions from Excel

    Hi,
    I am using the Excel VBA to create Access tables, but after a while the Access database becaome very big.

    How can I Using the "Compact and repair" utility in the Access from the Excel VBA. I would appreciate your help in finding the exact coding fo that.

    Thanks, neta.

  2. #2
    keepITcool
    Guest

    Re: Access Actions from Excel

    Neta,

    You cant do it using ADO, but you can with DAO.

    Sub CompactDB()
    Dim vFile, vTemp
    Dim oDBE As Object

    vFile = Application.GetOpenFilename("Database,*.mdb")
    If vFile = False Then Exit Sub
    vTemp = Left$(vFile, Len(vFile) - 3) & ".tmp"

    If Len(Dir(vTemp)) Then Kill vTemp
    Set oDBE = CreateObject("DAO.DBEngine.36")
    oDBE.CompactDatabase vFile, vTemp
    If Err = 0 Then
    Kill vFile
    Name vTemp As vFile
    MsgBox "Compacted " & vFile, vbInformation
    End If
    Set oDBE = Nothing
    End Sub

    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    neta wrote :

    >
    > Hi,
    > I am using the Excel VBA to create Access tables, but after a while
    > the Access database becaome very big.
    >
    > How can I Using the "Compact and repair" utility in the Access from
    > the Excel VBA. I would appreciate your help in finding the exact
    > coding fo that.
    >
    > Thanks, neta.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1