Calling a procedure from a different database

M

Maver1ck666

Hi,

I need to call a procedure from a seperate Access03 database using VB. So
for example, DL1 uses VB to call a procedure called 'Import' form DB1 which
runs & closes DB1 when finished.

Can someone provide me with some code please on how to do this as I am
unable to find any.

Kind regards,
Maver1ck666
 
A

Albert D. Kallal

It is not clear if you mean VB, or VBA?

I have a very simple windows scripting example here that explains how to
call code in MS access application via windows scripting, which of course
would work well for VB also, or virtually any other language that supports
object automation (that pretty well much means any windows development
platform).

note that to call the code in an application, a copy the application will be
launched, and if there's any startup code or forms they will also run, and
you might not want that behavior. a work around in this case is to simply
make a separate database with just the code, and linked tables to the actual
application, and that way you'll not have a bunch of startup code that gets
run when you automate to run your particular subroutine of code...

The sample vbs script is here:

http://www.members.shaw.ca/AlbertKallal//BatchJobs/Index.html

it is :

dim accessApp
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("C:\some path name\someMdb.mdb")

accessApp.Run "TimeUpDate"
accessApp.Quit
set accessApp = nothing

The Above script is vbs, but it would work equally well in VB, or VBA....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top