CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    17

    Trouble w\ Access Reference

    I am writing a VB program that reads and writes to a Access database.

    I am trying to use an Accsess reference to compact and repair the database.

    Access.Application.CompactRepair ("D:\WOR DATA\WOR_new.mdb")

    When I run the program I get an error of Argument not optional.
    Can some one please help me?

    Thanks in advance,
    Fish_8888

  2. #2
    Join Date
    Aug 2003
    Location
    Buenos Aires, Argentina
    Posts
    513

    Using DAO 3.6

    You can try this:
    Code:
    Dim DBE As DBEngine
    
        Set DBE = New DBEngine
    
        DBE.CompactDatabase "C:\MyDB.mdb", "C:\MyDBCompacted.mdb"
    
        Set DBE = Nothing

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

Featured