ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦bEXCEL¤¤¥ÎVBAÀ£ÁYACCESS¸ê®Æ®w¤TºØ¤è¦¡

¦bEXCEL¤¤¥ÎVBAÀ£ÁYACCESS¸ê®Æ®w¤TºØ¤è¦¡

½Ð°Ý¦U¦ì¤j¤j¦³¤Hª¾¹D³o¤TºØ¤è¦¡ªºÀu¯ÊÂI¶Ü?
¤p§Ì²Ä¤@¦¸­n¥Î¤£ª¾¹D­n±Ä¥Î­þ¤@ºØ¤ñ¸û¦n?
ACCESS¸ê®Æ®w¤@¯ë¬ù5~20MB
ÁÂÁÂ

¦³¤TÏú¤èªk¡G

1.¤Þ¥ÎDAO3.6压缩

Private Sub Command1_Click()
On Error GoTo Err_Handle
    Dim dbE As New DAO.DBEngine
    dbE.CompactDatabase "C:\­n压缩ªº.mdb", "B:\压缩¦Zªº.mdb"
    Exit Sub
Err_Handle:
    MsgBox Err.Description
    Exit Sub
End Sub

2.¥Îjet¤ÞÀº压缩数Õu库

¤uµ{-¤Þ¤J Microsoft Jet and Replication Objects Library  

Private Sub Command1_Click()

Dim FIXDB As New JRO.JetEngine
FIXDB.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:aa.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:aac.mdb"
End Sub

¡¦CompactDatabase ²Ä¤@个参数¬O­ì©l数Õu库¡A²Ä¤G个¬O¥Ø标数Õu库

3.¤Þ¥ÎACCESS压缩数Õu库

³]©w¤Þ¥Î¶µ¥Ø Microsoft Access X.X Object Library

    Dim objAcc As New Access.Application

©Î

    Dim objAcc As Object

    Set objAcc = CreateObject("Access.Application")

¤§«á

    Call objAcc.CompactRepair("c:\­n压缩ªº.mdb", "C:\压缩¦Zªº", False)

­ì¤å¥X³B
http://club.excelhome.net/thread-359331-1-1.html

²Ä¤@ºØ¤Î²Ä¤GºØ¤è¦¡µLªk³B²z .accdb ÀÉ

TOP

3.¤Þ¥ÎACCESS压缩数Õu库
³]©w¤Þ¥Î¶µ¥Ø Microsoft Access X.X Object Library
    Dim objAcc As New Access.Application
©Î
    Dim objAcc As Object
    Set objAcc = CreateObject("Access.Application")
¤§«á
    Call objAcc.CompactRepair("c:\­n压缩ªº.mdb", "C:\压缩¦Zªº", False)

PS.¨Ï¥Î«e»Ý¦w¸ËACCESS

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD