Results 1 to 2 of 2

Thread: Command Line Access

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2006
    Posts
    16

    Command Line Access

    I have written a script to back/compact/repair an msaccess db it works
    fine however i would like to determine if access successfully compact
    and repaired the database. How could i do this?

    I am running Access2k

    Here is the batch script:

    @echo off

    copy "w:\l&c\stats\StatsConvert2k.mdb" c:\backups\stats\%date:~-4,
    4%%date:~-7, 2%%date:~0,2%StatsConvert2k.mdb

    IF ERRORLEVEL = 1 GOTO COPYERR

    REM This compacts and repairs the live database
    START "" /B /MAX /REALTIME /WAIT
    c:\progra~1\micros~3\Office\msaccess.exe
    "w:\l&c\stats\StatsConvert2k.mdb" /COMPACT /WRKGRP
    c:\progra~1\common~1\system\System.mdw

    echo Task complete
    @echo %date:~-4, 4%%date:~-7, 2%%date:~0,2% STATS BACKED
    UP/COMPACTED/REPAIRED >> c:\backups\log.txt
    exit

    :COPYERR
    echo Error making backup compact/repair aborted
    echo %date:~-4,4%%date:~-7,2%%date:~0,2% COPY FAILED >>
    c:\backups\log.txt

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Command Line Access

    just use JetComp and pass in the DB name.. it will do the work for u
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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