Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Access Actions from Excel


Hi,
I am using the Excel VBA to create Access tables, but after a while the
Access database becaome very big.

How can I Using the "Compact and repair" utility in the Access from the
Excel VBA. I would appreciate your help in finding the exact coding fo
that.

Thanks, neta.


--
neta
------------------------------------------------------------------------
neta's Profile: http://www.excelforum.com/member.php...fo&userid=7624
View this thread: http://www.excelforum.com/showthread...hreadid=495435

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Access Actions from Excel

Neta,

You cant do it using ADO, but you can with DAO.

Sub CompactDB()
Dim vFile, vTemp
Dim oDBE As Object

vFile = Application.GetOpenFilename("Database,*.mdb")
If vFile = False Then Exit Sub
vTemp = Left$(vFile, Len(vFile) - 3) & ".tmp"

If Len(Dir(vTemp)) Then Kill vTemp
Set oDBE = CreateObject("DAO.DBEngine.36")
oDBE.CompactDatabase vFile, vTemp
If Err = 0 Then
Kill vFile
Name vTemp As vFile
MsgBox "Compacted " & vFile, vbInformation
End If
Set oDBE = Nothing
End Sub

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


neta wrote :


Hi,
I am using the Excel VBA to create Access tables, but after a while
the Access database becaome very big.

How can I Using the "Compact and repair" utility in the Access from
the Excel VBA. I would appreciate your help in finding the exact
coding fo that.

Thanks, neta.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel PivotTable Additional Actions Disabled Manoj Excel Discussion (Misc queries) 0 January 17th 09 08:56 AM
Excel 2003 pauses after copy or paste actions Inspector Gadget Excel Discussion (Misc queries) 7 September 28th 08 05:36 AM
Adding sub-menus and actions to data in drop down lists in Excel 2 cchcc Excel Worksheet Functions 1 May 2nd 06 03:38 PM
Using non standard actions on an Excel 97 pivot table Hackensack Excel Discussion (Misc queries) 2 April 3rd 06 07:27 PM
Timeout for OLE actions in Excel 2003 Tonny[_2_] Excel Programming 0 April 5th 04 01:56 PM


All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"