Solved

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

Posted on 2015-02-23
3
242 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

808 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