Solved

Passing Values / Triggering Event Between Web and Desktop Application

Posted on 2008-10-23
5
289 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

617 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