Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

Run Access Macro from VB/ADO

Can someone give me the Visual Basic code to run an Access '97 Macro through ADO?
0
Maxim10553
Asked:
Maxim10553
  • 2
  • 2
1 Solution
 
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
 
DiveblueCommented:
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
 
Maxim10553Author Commented:
cool, ill give it a try
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now