其中工作组的用wmd文件已存在而且知道用户名与密码
如果不带工作组的的优化如下,那带工作组的呢如何
Dim srph As String, ysdb As String Dim je As New JRO.JetEngine
srph = CurrentProject.Path & "\base000.mdb" ysdb = 路径
If Dir(srph) <> "" Then Kill srph je.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ysdb & ";Jet OLEDB:Database Password=" & "", "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & srph & ";Jet OLEDB:Database Password=" & ""
Set je = Nothing FileCopy srph, ysdb Kill srph MsgBox "源数据文件已优化! :)", vbInformation, "提示" End If