Solved

Return value from VB6 application from MS Access adp

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Info Path 2013 with Office 2016 Pro Plus and Standard 2016 1 49
Office 2016 User Guides 5 33
fso.FolderExists("\\server\HiddenFolder$") 4 51
Microsoft Edge, Outlook OWA 7 43
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now