Command Line Troubles

  • Thread starter Thread starter callmeroot
  • Start date Start date
C

callmeroot

I created a .cmd file that does the following:

cd \

"C:\Program Files\Microsoft Office\OFFICE\msaccess.exe"
"c:\billingdb\lvg database_be.mdb" /nostartup /x Master

I scheduled the task to run daily.

Problem:
It says "running" and never truly finishes.

*This task/file runs on a server.
*The server runs 247 but I'm logged off (Didn't think that would be the
reason why).
*When I log in, Access isn't started up when I log in.
*Some of the tables are linked (ODBC) and require a password- Still
trying to figure out how to save the password.
*When I manually start it, Access opens up and asks for the password.
After it runs, the Access window doesn't go away and the task still
says "running." When I manually close the window- only then does it say
it has been finished.


Is the problem with the password for the linked tables? Or a
combination or problems?

Thanks for your help in advance!
 
Problem:
It says "running" and never truly finishes.

if you launch any application...it will not shut down all by its self (how
will it know!!!).

You have to put a quit in at the end of your routines...most use

application.Quit

So, there is no possible way that windows can guess, or know that the
application is ready to quit...it can't read minds!!!

*When I log in, Access isn't started up when I log in.
*Some of the tables are linked (ODBC) and require a password- Still
trying to figure out how to save the password.

you can't possibility try and run something as a scheduled task that
prompts!!! When you run it..it will be sitting in a session waiting for a
prompt (that is no doubt why you see the task running..but it never
finished...it is sitting waiting for a prompt

I think it goes without saying that your application cannot have any
prompts..and it goes without saying that your code that runs in the
application needs to shutdown. I would test this LONG LONG BEFORE you try
running this as a scheduled task.

Make it work correctly..and shut down all by its self. Then, and ONLY then
should EVEN BEGIN to consider testing this as a scheduled task.
*When I manually start it, Access opens up and asks for the password.

Is the above talking about the odbc linked table password, or the ms-access
workgroup security log on?

For the odbc linked tables, you will need to delete the table link, and
re-link to the odbc source. Note the little check box when you link that
says "remember password". (this will eliminate the odbc prompt).

So, when you link tables to a odbc source...ms-access can remember the
password..and no prompts will occur

If you are talking about workgroup security...then you simply supply the
password in the command line parameters....

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
"c:\program files\RidesXP\RidesXP.mdb"
/wrkgrp "c:\Program Files\RidesXP\Rides.mdw"
/User "RidesAdmin" /pwd "zoozoo"

After it runs, the Access window doesn't go away and the task still
says "running." When I manually close the window- only then does it say
it has been finished.

You mentioned that when you run the appcation, it prompts you. You just have
to eliminate those prompts.
.....who is answering those prompts?

The task will have to run with no prompts..and shut down after done. (using
a application.quit in your code). Any prompts that occur must be eliminated,
or the program will just sit there waiting for someone to enter some
values.....
Is the problem with the password for the linked tables? Or a
combination or problems?

No, the problem is that when a program prompts for user input..it waits.
 
Thank you very much for your reply/help. I forgot about the
application/quit. Thinking now it seems silly to think otherwise.
 
Back
Top