?
Solved

Return value from VB6 application from MS Access adp

Posted on 2010-11-17
5
Medium Priority
?
525 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
[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
5 Comments
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 600 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 600 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 800 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

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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

777 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