Solved

Return value from VB6 application from MS Access adp

Posted on 2010-11-17
5
501 Views
Last Modified: 2012-08-14

I have a small vb6 app that has no database behind it.  I would like for my ms access adp app to launch the vb6 app and return a value.

Is this possible? I have been trying for 2 days

Frank
0
Comment
Question by:FrankRam
5 Comments
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 150 total points
ID: 34156565
As an EXE?  No.

Can you compile the VB6 stuff as a DLL?  If you do that, you can get a return value from a function call to that DLL.
0
 
LVL 14

Assisted Solution

by:Brook Braswell
Brook Braswell earned 150 total points
ID: 34156608
You could do a couple of things here
1.  You can call the other application from a shell command
cPath = "\\Server\AppPath\"
Shell cPath & "AppName.Exe",vbNormalFocus

2.  You can pass information by writing to a file from App2 and reading it from App1
    Have App1 wait for the file if necessary with a timeout then read the response and remove the file afterwards...

3.  Have App2 write to a registry location that App1 will read from.
    App1 can set the registry value to a default or a wait value, App2 can write to Same registry value
   App1 can read from registry until changed by App2 or TimeOut

4.  Check out this link
http://www.codenewsgroups.net/vb/t6279-how-can-vb-exe-return-value.aspx



0
 
LVL 8

Accepted Solution

by:
davesgonebananas earned 200 total points
ID: 34156963
Set your VB6 project type to ActiveX EXE and place your code in a public method on a public object.

In your MS Access VBA project add a reference to the EXE - Tools | References... | Browse...

You should be able to confirm that your VB6 object is now accessible in the Object Browser - Press F2 and change <All libraries>

Now you can call your EXE from code using the following:

Dim oMyProject
Dim retVal
oMyProject = New MyProject.MyObject
retVal = oMyProject.MyMethod

Open in new window

0
 

Author Closing Comment

by:FrankRam
ID: 34157894
Not sure what the points do guys.  but thanks for the solutions
0
 

Author Comment

by:FrankRam
ID: 34157904
Thanks for the help.  I really appreciate it.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
checkbox to hide entire section 10 41
Web Query 1 20
populate  some cells after data verification 45 23
Excel formula to report date modified 14 24
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

856 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