Solved

Return value from VB6 application from MS Access adp

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

16 Experts available now in Live!

Get 1:1 Help Now