I would actually suggest you put that code in the other program!!
Remember, you can open, read, and write mdb (access) files on a any windows
XP computer, and don't even have to install ms-access.
So, every copy of windows ships with JET, and thus you don't have to use
ms-access to read, or write, or in fact run code...
Unless that code is going to use a specific feature of ms-access, then I
would suggest not using ms-access as a com (automation) object...
You likely would be better off to use a DAO library ref, and then
read/write,
or execute some sql statements.
Further, when you do automate ms-access, and all kinds of things such as
start up code, forms running etc can occur, and for most part, a access
applications does run a lot of things in startup..and, if you launch
ms-access
as a com object, the same thing occurs.
Anyway, the code to launch ms-access, and run some code (a sub called
timeupdate)
in a standard code module from a windows batch file (script) would be:
dim accessApp
msgbox "Click ok to run batch job",64
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("C:\Documents and Settings\Albert\My
Documents\Access\ScriptExample\MultiSelect.mdb")
accessApp.Run "TimeUpDate"
accessApp.Quit
set accessApp = nothing
msgbox "Job complete", 64
You can adopt the createObject for any language from c++, vb6, or even
another copy of ms-access running...
However, as mentioned, when the above open database occurs...startup code,
forms that load on startup etc. will run. And, since c++, VB, or any windows
programming environment can read/write the mdb file direct, I don't think
using ms-access as a automation object is likely needed here....
Further, if you do automate ms-access, likely you would want to build a mdb
*just* for that automation, since as mentioned, you don't want all of the
application stuff you setup to run on startup to run in this case...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)
http://www.members.shaw.ca/AlbertKallal