Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Compact and repair Back End From Front End at Runtime

Discussion in 'Information Technology' started by bobdydd, Jul 28, 2006.

  1. bobdydd

    bobdydd
    Expand Collapse
    Guest

    Hi Everybody

    For Microsoft Access 2000 and above
    Windows XP

    I am trying to mimic the action of this command that at the moment runs
    from the start>>all programs at the bottom left of the screen.

    "C:\Program Files\Microsoft Office\ART\Office\MSACCESS.EXE" _
    /excl /runtime /profile "MYDB" /wrkgrp _
    "C:\Program Files\Stortvalley\MYDB2\system.mdw" _
    /repair "C:\Program Files\Stortvalley\MYDB2\MYDB2_Be.mdb" /compact

    The idea is to be able to compact and repair the Backend database from
    a command button on the Front End mde on a machine that has not got
    full version Microsoft Access on it.....just the ART (Access Run Time)

    Thanks for any help

    Bob
     
  2. Loading...

    Similar Threads Forum Date
    SciTech Mussel byssus could lead to new ways to repair bones and tendons Breaking News Jul 30, 2013
    Controversial 210 years on, Golden Temple gates removed for repairs Hard Talk Jul 5, 2010
    Sikh News J&K Sikh devotees seek repairs to bridge (The Hindu) Breaking News Apr 21, 2008

  3. OP
    Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    Use the CompactDatabase method of the DBEngine.

    What I typically do is rename the existing backend, putting in today's date
    and changing the extension to .bak. I then compact that to the "correct"
    database. That way, I have a backup as well.

    Dim strCurrentBackend As String
    Dim strRenamedBackend As String

    strCurrentBackend = .....
    strRenamedBackend = Left$(strCurrentBackend, Len(strCurrentBackend) - 4)
    & _
    Format$(Date(), "yyyymmdd") & ".bak"

    Name strCurrentBackend As strRenamedBackend

    DBEngine.CompactDatabase strRenamedBackend, strCurrentBackend


    I've left out how to determine where the current backend is, but it's pretty
    straightforward. One way is to check the Connect roperty of a linked table,
    and strip off the ";DATABASE=" from the front of it:

    strCurrentBackend = Mid$(CurrentDb().TableDefs("MyLinkedTable").Connect,
    11)

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "bobdydd" <reallyuseful2004@yahoo.co.uk> wrote in message
    news:1147433910.887517.32110@i39g2000cwa.googlegroups.com...
    > Hi Everybody
    >
    > For Microsoft Access 2000 and above
    > Windows XP
    >
    > I am trying to mimic the action of this command that at the moment runs
    > from the start>>all programs at the bottom left of the screen.
    >
    > "C:\Program Files\Microsoft Office\ART\Office\MSACCESS.EXE" _
    > /excl /runtime /profile "MYDB" /wrkgrp _
    > "C:\Program Files\Stortvalley\MYDB2\system.mdw" _
    > /repair "C:\Program Files\Stortvalley\MYDB2\MYDB2_Be.mdb" /compact
    >
    > The idea is to be able to compact and repair the Backend database from
    > a command button on the Front End mde on a machine that has not got
    > full version Microsoft Access on it.....just the ART (Access Run Time)
    >
    > Thanks for any help
    >
    > Bob
    >
     
  4. OP
    bobdydd

    bobdydd
    Expand Collapse
    Guest

    Hi Doug

    As always you get me out of trouble ...................Thanks
    I have not tried it on a machine without Full version Access installed
    (just the ART) but I reckon it will work.
    I altered it slightly to put the Backups it a different directory

    Once again Thanks a lot

    Bob
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page