Solved

Run Access Macro from ASP Page?

Posted on 2001-08-05
2
552 Views
Last Modified: 2012-08-14
I am creating new web based user interface for MS Access database. Some of the old maintenance procedures are stored as MS Access Macros. Is there any method to do it (execute) inside ASP page?

I found something which is working on PWS, but I am not sure about this solution.

<%
Dim acS
Dim acCmd
Set acS   = CreateObject ("access.Application")
acS.OpenCurrentDatabase "D:\www\Inetpub\scripts\asp.mdb"
Set acCmd = acS.DoCmd
acCmd.RunMacro "TestMacro"
%>
0
Comment
Question by:ppy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6355662
Does this macro require any user intervention? If it does, I wouldn't even attempt to run it (even if you can) unless somebody is at the server to respond.
0
 
LVL 11

Accepted Solution

by:
jekl2000 earned 100 total points
ID: 6356211
This works for me, runs everyday (using Access 97)
Visible can be true or false depending on rather you want to see access start or not. On IIS you also have to set the "Allow out of process components" to yes  in order to run access,,or excel etc.



<% Dim objAcc
Set objAcc=Server.CreateObject("Access.Application")
objAcc.Visible=true  'or false'
objACC.OpenCurrentDatabase "d:\webdb\steelers.mdb"
objAcc.DoCmd.RunMacro "Macroname"
objAcc.CloseCurrentDatabase
Set objAcc=Nothing%>
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question