We have an application developed in VB.NET as well as in VBA in the client. In a installer custom action developed in VB.NET we compile mdb file to mde using the Access's SysCmd 603 which is famously undocumented. The sample code looks like this:
a = CreateObject("Access.Application")
If a.SysCmd(603, PATH_TO_BXB_FILE, PATH_TO_BXE_FILE) = 0 Then
MsgBox("Fail to compile to MDB file")
End If
This code worked before until recently. Now the Syscmd call returned 0 which indicates the compile failed. But since I am not familiar with Access programming, I don't know how to check further the cause of this fail. In this link Application.SysCmd Method (Access) it says it will generate a run-time error in case of failing, but I don't know how to check this error. Please help
The 603 argument of syscmd is undocumented. It will fail for a number of reasons, for example, running under VBA it will fail if you do not use a separate instance of MS Access. In this, other reason to fail are given as:
- when it's used in VBA code running in a separate Access database (separate from the solution database);
- when the solution database is closed; and
- when there are no syntax errors in the VBA code in the solution database.
The document also lists these references:
Douglas Steele makes an interesting point here:
http://www.pcreview.co.uk/forums/thread-2621925.php
Tony Toews investigates undocumented SysCmds here:
https://msmvps.com/blogs/access/archive/2007/08/19/so-what-are-the-undocumented-syscmd-items.aspx
Tony Toews also links to this page:
http://www.everythingaccess.com/tutorials.asp?ID=Undocumented-SysCmd-Functions