Is it possible to open an .mdb/.accdb file (either client-side or server-side) that includes command-line parameters?
What I'm eventually trying to accomplish is embedding a link (with parameters) within an Outlook email (being generated in another Access db via button's OnClick VBA) and when the recipient clicks the link, it automatically opens the .mdb/.accdb file where they can print off the current version of a report(s) based of these parameters.
First attempt
Originally, I was doing this with a batch file located on one of our servers (embedding a link to this batch file in the generated email):
@echo off
xcopy "\\server\share\thisdb.accdb" "C:\local\*.*" /Y
start msaccess.exe "C:\local\thisdb.accdb" /cmd "param1;param2"
...However, this obviously leads to UAC and overall email security concerns.
Second attempt
So, after discussing this with colleges, they suggested constructing a website. Not a problem! Got an ASP.NET VB website up and running in the same day, plus figured out how to pass and grab query strings from link to site.
The problem begins when it comes to attempting to open Access on the client and/or server...
I've tried...
- Shell
- System.Diagnostics.Process (with/without System.Diagnostics.ProcessStartInfo)
- etc... etc... (I don't recall all the methods I've tried from online sources)
Why I'm doing this
For quite some time now, I've simply done the following in VBA:
- Auto-generate the email
- Exported (and attached) the multiple reports as PDF files
- Displayed the email
Over time, this takes a lot of space on our servers and leads to end users looking at out-dated information. My end goal is to create a solution that achieves the following:
- Smaller email sizes (benefiting our email server greatly)
- The ability for end users to click an embedded link in an email (without any security issues) and open the current version of the report(s)
- Do this all in the same mouse clicks (give or take a mouse click) as opening an attached PDF in an Outlook email
Any help/suggestions is greatly appreciated :)