Solved

Running Access Database macro from .aspx web form using visual basic

Posted on 2015-02-23
3
259 Views
Last Modified: 2016-02-11
I would like a macro to be executed, when a certain button is pressed on the form. Have found a couple of solutions, all of them start with something like Dim Adb As New Access.Application
But in my version of Visual Studio (2013 for Web) there isn't such type of variable as Access.Application, so it doesn't work.
0
Comment
Question by:German Mikulski
[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
3 Comments
 
LVL 85
ID: 40625366
Macros and VBA Code must be run in the Access environment. You can use the Office Interops assembly to do these things:

https://msdn.microsoft.com/en-us/library/15s06t57.aspx

However, since you're presumably running this on a web server that is NOT local to the Access database, I'm not sure you'll be able to do this. You cannot open an Access database that is not on the same physical network as your own (i.e on the same LAN or WAN), and it would be doubtful your web server is on the same W/LAN. Also you'd need to have those Office Interops assemblies installed on the web server (which is mot likely not going to happen unless you own and host the web server yourself).

What does the macro do? There might be a different way to manage it ...
0
 

Author Comment

by:German Mikulski
ID: 40625388
This is relate to the previous question you were trying to solve for me :)
http://www.experts-exchange.com/Database/MS_Access/Q_28614652.html

I'm still trying to come up with some kind of solution for this problem.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40625397
I posted a comment over there, but it looks like you're moving to an ASP.NET solution?

If so, then my original comment applies - unless your database is local to the web server, you can't do this.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

689 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