We are trying to write a batch script to open an Access DB using our enterprise scheduler (UC4). Once the database is opened it runs a macro.



We have a few problems -
In the script we CD to the directory where the database is. We have a dispute about whether or not we need to call Access first in the script.

The original script just looked like this:
CD\
CD CLT-DB-TEST
ISI.MDB
CD\
EXIT

The next version of the script looked like this:
CD\
CD CLT-DB-TEST
"C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\CLT-DB-TEST\ISI.mdb"
CD\
EXIT

We aren't exactly sure if either of these are working because every time we run the script from the batch scheduler it creates a .ldb file and will not release it.

We think that it is working up until a certain point but, because the database won't close, it isn't completing the macro.

The batch scheduler creates temp files to which to write while the job is executing. When the job completes they should be removed. Due to the fact that the job is not completing there are temp files that are seen as "in use" and will not let me manually delete them.

The caveat to that is if I reboot the server I can delete the temp files and remove the .ldb file.

Some other items of note are:
1. I can start the job, despite the fact that the .ldb is present.
2. I can see that the date and time on the .mdb and .ldb files update when I start the job.

When I run the script that calls Access first native on the server, I see the database open and close. When I run the script that does not call Access first I don't see the database open.

I really think my problem is that I need to put error checking in or find some way to end the job and I don't think that changing directories back to root and then exiting is the way to do it.

Any help or suggestions would be greatly appreciated!