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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compact an Access database from DTS

Status
Not open for further replies.

rhofing

MIS
Dec 12, 2001
25
0
0
CA
Hello, I have a DTS package that inserts and deletes data in an Access database. I want to compact the Access database using the compactdatabase method. This is a DAO object. I will need to do this from an ActiveX task.

Can someone show me some sample code or explain how to do this?

Thanks!

Ric
 
You can create a "Execute SQL Task". Within it you may have code in some form of this command ... You may need to add a few more parameters if you are required to supply a user/pass combination...

exec master..xp_cmdshell
'c:\Program Files\Microsoft Office\Office\msaccess.exe Northwind.mdb /Compress'



Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top