Solved

Passing Values / Triggering Event Between Web and Desktop Application

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

773 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