Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open, run compact & repair Access db w/VB

Status
Not open for further replies.

vber

IS-IT--Management
May 13, 2002
1
US
I know this sounds easy and it should be, but I can't get this to work. As soon as the Access db opens, it closes again. I need to have a specific Access db open, I need to run repair and compact and have it shutdown. Anyone done this in vb script?
 
The easiest way is to just run the msaccess executable with the /repair switch. The following script attempts to repair the file test.mdb:

Set objShell = WScript.CreateObject("WScript.shell")
objShell.Run "msaccess d:test.mdb /repair", ,True

Regards,

Stein Borge
Author of: Managing Enterprise Systems with the Windows Script Host
Over 800 pages of practical solutions oriented material, providing detailed coverage of WSH 5.6, WMI,
ADSI, ADO, CDO, FSO and much more.
sb@nyetspam.enterprisewsh.com <- remove nyetspam when E-mailing
 
Thanks Stein,
Actually your book is just what I have been looking for. I plan to order a copy today.
Dale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top