?
Solved

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

Posted on 2015-02-23
3
Medium Priority
?
266 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 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 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