Solved

Passing Values / Triggering Event Between Web and Desktop Application

Posted on 2008-10-23
5
288 Views
Last Modified: 2013-11-27
I have developed a web based application in Classic ASP with a Visual Basic application to navigate through print send emails etc.  I have hit a brick wall and could do with some help passing values or triggering an event when a button on my webform is clicked to run some code on the VB App.

Hope that makes sense, so the two things i need advice on are:
1. how to trigger an event on my vb app from a webpage
2. how to pass variables from my web app to my vb app.

Many Thanks in Advance.
0
Comment
Question by:Ross-C
[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
  • 4
5 Comments
 
LVL 27

Expert Comment

by:jjafferr
ID: 22798179
Hi Ross

Easy part 1st, 2nd Q:
Please read both of my posts in this Q:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_21991495.html
the 1st post will give you a link to anothe post, where the data are sent from Access to the Web page, the code clicks a button, waits for results, then captures the values from the web page to Access.
Similar thing, but in another post, with embeded browser in Access:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23045378.html

2nd Q:
If you mean to send a command from your web page to a sub or a function in Access, then I am sorry, but I don't know how to do that,
I don't know if ODBC can help here.
But I can think of the following:
a. when clicking for a function from your web page, create a text file on your PC, with the command required.
b. make an intermediate Access mdb, where the timmer continuously looks for that file name which the web page can create, if it finds it, then it can open the main mdb and run the sub/function you want. In fact I think it can run it from a command line too.

jaffer
0
 
LVL 27

Accepted Solution

by:
jjafferr earned 250 total points
ID: 22799722
ok, as for the 1st Q:
you can start Access from a shell command, which you can place in your web page, and include which Function you want to run, this Function can be run using the Access Macro.

The following example will run macro1 in c:\Frames_Colors.mdb:
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "c:\Frames_Colors.mdb" /x macro1

so what you should do is, have different Functions/Macros for different purposes, then run the one you need.

jaffer
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 22799751
and here are the rest of the switches, just in case you need them:
http://www.vb123.com/workbench/help/commandline.htm
0
 
LVL 11

Author Closing Comment

by:Ross-C
ID: 31509163
many thanks
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 22803975
Thanks for the points and the grade :)

To continue on this subject, now that I am into it :)

1. unfortunatly I couldn't find a way to directly run a Fuction in Access, so this will make us write more code, to test if Access was open, and if it was, then how to run that Function?

2. what if we want to pass a value to a Function, from the web page?
We cannot do this directly (that is to send the value along with the call to the Function, like: Call myFunction(myValue)
so what we can do is:
have that value ready on your web page,
run the Fuction,
have the Function to read this value from your web page (see my answer to your 2nd Q),
and if the Function is suppose to return a value to the web page, then send it to the web page (see my answer to your 2nd Q).

jaffer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

739 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