Run Access Macro from VB/ADO

Can someone give me the Visual Basic code to run an Access '97 Macro through ADO?
LVL 3
Maxim10553Asked:
Who is Participating?
 
DiveblueConnect With a Mentor Commented:
set a reference to microsoft access in the project/references menu...then

Dim oAcc As New Access.Application

With oAcc
   .OpenCurrentDatabase "c:\mydb.mdb", False
   .DoCmd.RunMacro "macroname"
End With

set oAcc = nothing
0
 
DiveblueCommented:
You can't do it through ADO or DAO, you need to use OLE

Access.Application...etc
0
 
Maxim10553Author Commented:
can you give a link or examples?
0
 
Maxim10553Author Commented:
cool, ill give it a try
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.