Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing Values / Triggering Event Between Web and Desktop Application

Posted on 2008-10-23
5
Medium Priority
?
293 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 1000 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

972 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