Re: Compacting an Access database with DAO




"John L." <JohnL@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7E349F96-08FD-41AD-A3E0-6F1410983BB3@xxxxxxxxxxxxxxxx
We have a few databases with linked tables to SQL Servers and when we
attempt
to compact these databases by programmatically, it fails due to SQL Server
login information. I understand that you cannot use Microsoft Access to
compact and repair a SQL Server database, but we do have some native
Access
tables + forms/reports etc within the database; which we would like to
compact and repair. Is there a work around for this?

Thank you for your help.


I'm with Bob here, as your question is a bit vague.

To compact a database with DAO you must have access to the mdb file, and all
users must have released it. (no one logged in). ie, you can't compact a
database through a linked table.

[If using any mdb previous to Jet4, you have to do it in two steps, Repair
and Compact. With Jet4 you only need to call Compact.]
RepairDatabase "C:\myData1.mdb"
CompactDatabase "C:\myData1.mdb", App.Path & "myDataNewName.mdb",
<optional_locale>, <optional_options>, <optional_password>

-ralph



.



Relevant Pages

  • Re: Join Split Database
    ... Correction - I was able to compact and repair; it was when I tried to import ... Make two copies of the BE file and place in separate folders on ... Best case scenario is the users will not need to use the database ...
    (microsoft.public.access.gettingstarted)
  • Re: Invalid bookmark when entering data in a subform
    ... The compact and repair, decompile and compile, and importing into a new ... And here is a standard sequence to fix a problem database. ... Still in the code window, choose Compile from the Debug menu. ...
    (microsoft.public.access.forms)
  • help with corrupt database
    ... I read your post below in the hope of finding help with a database that's ... I can't run the compact & repair utility now - I just get the same error. ... Do you think this file is corrupt beyond repair then? ...
    (microsoft.public.access.tablesdbdesign)
  • Re: "There isnt enough memory to perform this operation"
    ... Our method of dealing with the problem so far is saving a lot and Compact & ... leaving Design mode. ... Run Compact & Repair on one of the copies. ... large app -- about 72 MB of program with tables linked to another Access ...
    (microsoft.public.access.tablesdbdesign)
  • Re: #Name? error
    ... Have you done a compact and repair, or a decompile followed by compact and ... What happens if you create another database as a test, keep it simple, use ... Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia ...
    (microsoft.public.access.forms)

Loading