[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Passing parameters into a VB 6.0 program

Posted on 1999-10-27
5
Medium Priority
?
304 Views
Last Modified: 2010-05-02
I need to start up a VB 6.0 program from a program on an AS/400 while passing in certain parameters. I already know how to launch a VB executible from the AS/400 but how do I pass in parameters to the program?
0
Comment
Question by:Bucks
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:AnswerTheMan
ID: 2163876
you can update first some REGISTRY ENTRIES.
Th VB6 app will read those values from
registry.
0
 
LVL 22

Accepted Solution

by:
ture earned 2000 total points
ID: 2164719
Bucks,

You should use COMMAND function to return command line arguments specified when starting the VB application.

If your VB application is named MyApp.exe in the directory C:\Test\ and you wish to pass the argument John, start your app like this:

C:\Test\MyApp.exe John

This code in your app will set the variable c to whatever you passed as a command line argument when starting the application and show the value.

Private Sub Command1_Click()
  Dim c As String
  c = Command
  MsgBox c
End Sub

Ture Magnusson
Karlstad, Sweden
0
 

Author Comment

by:Bucks
ID: 2165601
I quess I needed to tell you, I am NOT an avid VB programer. When you say to write to the registry, I have no idea of how to do this. Could you explain that in a little more detail?
0
 

Author Comment

by:Bucks
ID: 2165611
That is exactly what I was looking for. Thank you.
0
 
LVL 22

Expert Comment

by:ture
ID: 2165620
You are welcome, Bucks! I'm glad that I could be of assistance.

/Ture
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

591 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