我们有一个仍在生产中的遗留Access应用程序.我想至少有一个自动构建它.你能从命令行构建访问exe吗?
更好的是,不会有任何机会成为Access的MSBuild目标吗?
这适用于我2010年.需要一些时间来管理它.
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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1907 次 |
| 最近记录: |