Another instance of Access running prevents /cmd Command switch from processing

mdlueck

Sr. Application Developer
Local time
Today, 09:41
Joined
Jun 23, 2011
Messages
2,650
I found an odd bug in A2007. I am making use of the startup switch /cmd to be able to process a specified task when my application starts.

The /cmd switch is only received / processed by Access when the started instance of Access is the ONLY one running on the computer... no matter if other instances have a different database open, or none at all.

Any ideas why other instances of Access running on the same machine prevent the /cmd Command line switches from being received? Anyway known to correct this limitation?

Example of the bug:

Access running as the only instance on the computer:
Code:
Debug.Print Len(Command()) & " >" & Command() & "<"
30 >This is a way cool test!      <
Access running a the "all databases closed" screen, another instance started from the command line with the same command line switches:
Code:
Debug.Print Len(Command()) & " >" & Command() & "<"
0 ><
:confused:
 
I do not have this issue on my 2007 or 2010 machines, how are you launching the applications?
 
how are you launching the applications?

Command line:
Code:
start "Fandango Agent Server" Fandango_AgentServer.accdb /cmd "This is a way cool test!"
 
Ah, I'm using the full path to the application, so rather than start, I'm using
"C:\Program Files\<InsertOfficePathHere>\MSACCESS.EXE" "database Path here"
 
hhhmmm... indeed it works when starting it not via the data file extension association:

Code:
"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" C:\Distrib\Fandango\Fandango_AgentServer.accdb /cmd "This is a way cool test!"
Code:
Debug.Print Len(Command()) & " >" & Command() & "<"
24 >This is a way cool test!<
And invoking that way eliminates the trailing white space I was seeing tacked onto the output of Command().

I guess I shall swap methods to invoke this application. Thank you.
 

Users who are viewing this thread

Back
Top Bottom