Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP with Access Macros

Status
Not open for further replies.

newconvix

IS-IT--Management
Jan 30, 2006
16
US
Hello all! I've created a macro in Access 2003 that I'm trying to run from classic ASP. The macro generates a report and automatically prints it out, and quits the application. When I run the macro alone, or from a batch file (msaccess <filespec> /X:<macroname) it works fine.

However, the goal is to have the macro run automatically from the ASP script. I've tried two options: 1), using the Server.CreateObject("Access.Application"), DoCmd.RunMacro method, and I've also tried using Windows Scripting Host.Run method to shell out and run a batch file.

Neither method works. The WSH method appears to work fine (i.e., doesn't cause any HTTP errors), but the report isn't printed. The "Access.Application" method results in HTTP error 500.

Finally, the macro is using the default printer of Adobe PDF, if that would make any difference. Anyone have any ideas?
 
Unless they have been specificly overridden, the default security on the web site will execute your ASP using the security context of the local IUSR_ServerName account. Is it possible that this account does not have permissions on your access .MDB file or your .BAT file?

PS: Do you want a web page that causes something to be printed by the server?
 
I viewed the application log on the webserver, and saw that I needed to grant activation permissions for the IUSR account. I found them in the Component Services snap in and made the appropriate changes.

Basically, the macro prints an Access report to a .PDF file in a certain directory. Then, a link to that file will be presented to the user. *still scratching head*

Thanks!
 
So does it work now? I didn't quite understand your followup posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top