Solved

Return value from VB6 application from MS Access adp

Posted on 2010-11-17
5
514 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 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

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…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

729 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