We have a legacy Access application that is still in production. I would like to at least have an automated build for it. Can you build access exe's from the command line?
Even better, there wouldn't by any chance, be an MSBuild target for Access would there?
This works for me 2010. Needed some time to manage that.
Function makeAccde()
Dim source, temp, target As String
DoCmd.RunCommand acCmdCloseAll
source = CurrentProject.path & "\" & CurrentProject.name
temp = CurrentProject.path & "\" & "_tmpCompile.accdb"
target = Left(source, Len(source) - 1) & "e" 'you can also use "r"
Dim db As New Access.Application
DoCmd.RunCommand acCmdCompileAndSaveAllModules
Set aFSO = CreateObject("Scripting.FileSystemObject")
aFSO.CopyFile source, temp, True
db.AutomationSecurity = msoAutomationSecurityLow
db.SysCmd 603, temp, target
db.Quit
Kill temp
Application.Quit ' if you do not quit current db, sometimes target file is corrupted.
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With