I want to create a (new) accdb file that I can put on a scheduler to autoexec the code to copy and compact various accdb files in different servers.
I am stuck at the part of connecting to the database. This is the code I had before:
Public Sub doCompact()
Dim JRO As JRO.JetEngine
Set JRO = New JRO.JetEngine
JRO.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDestFile & " ; Jet OLEDB:System Database=Q:\PerceptaTools\PerceptaTools.MDW ;User id=annie;Password =irock; ", _
" Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strSourceFile & "; Jet OLEDB:Engine Type=5 "
Set JRO = Nothing
End Sub
---------------------------------------------
sorry i'm a newbie I don't know how to put my code in that box thingy I see everyone else uses when putting code on their posts.
Can anyone help?
Thanks
I am stuck at the part of connecting to the database. This is the code I had before:
Public Sub doCompact()
Dim JRO As JRO.JetEngine
Set JRO = New JRO.JetEngine
JRO.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDestFile & " ; Jet OLEDB:System Database=Q:\PerceptaTools\PerceptaTools.MDW ;User id=annie;Password =irock; ", _
" Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strSourceFile & "; Jet OLEDB:Engine Type=5 "
Set JRO = Nothing
End Sub
---------------------------------------------
sorry i'm a newbie I don't know how to put my code in that box thingy I see everyone else uses when putting code on their posts.
Can anyone help?
Thanks