Solved

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

Posted on 2015-02-23
3
226 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
  • 2
3 Comments
 
LVL 84
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 84

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now