Solved

Problem running an AS400 command line from VB.NET

Posted on 2012-03-27
6
1,273 Views
Last Modified: 2012-03-28
I am trying to run a command statement from VB.NET to an AS400 machine using the following code but get a CWBCO1049 error (See ERROR OCCURS ON THIS LINE below) - The IBM I Server is not started or the connection was blocked by a firewall.  

The IBM I Server is started.  I am using VB.NET 10 Express on a Windows 7 machine.

Any suggestions would be helpful.


 Dim system As New cwbx.AS400System()
        On Error GoTo failed
        Dim YOUR400 As New cwbx.AS400System
        Dim servers As New cwbx.SystemNames
        Dim Command As New cwbx.Command

        'YOUR400.Define(servers.DefaultSystem)
        Command.system = YOUR400

        ' Enter USERID and PWD so the users will not be prompted
        Command.system.Define("as400")

        Command.system.UserID = "joesmith"
        Command.system.Password = "mypass"
        Command.system.IPAddress = "100.100.1.1"

        ' ERROR OCCURS ON THIS LINE.
        Command.Run("CHGUSRPRF USPRPF(bobjones) STATUS(*ENABLED)")

Thanks,

Elliot
0
Comment
Question by:esemmoc
6 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 350 total points
ID: 37772141
Try the approach used in the question here

http://www.experts-exchange.com/OS/AS_-_400/Q_24367101.html
0
 

Author Comment

by:esemmoc
ID: 37772377
Thanks but my program already receives the AS400 error code -- CWBCO1049.  I am looking for what is causing this error and how to fix it.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37774027
I linked to that question because code is slightly different. For example, he is using ip address in define method where as you are using "as400". He is calling the system.Signon method before running the command and you are not.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 16

Assisted Solution

by:theo kouwenhoven
theo kouwenhoven earned 25 total points
ID: 37774112
Yes CodeCruser is right,

Try to use the Command.system.Signon();

If you have still problems, replace the Command.system.Define("as400")
with Command.system.Define("100.100.1.1") and skip the Command.system.IPAddress part.

Regards,
Murph
0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 25 total points
ID: 37774566
...the AS400 error code -- CWBCO1049

That's not an AS/400 error code. That's an error from PC code.

The IBM I Server is not started or the connection was blocked by a firewall.

That's the error that needs to be handled. At that point, you don't even have a useful connection that you can logon to. You haven't gotten far enough to get an AS/400 error code.

The IBM I Server is started.

How did you determine that? If it is in fact true, then you have a problem with the route to the AS/400. It might be a hardware or software firewall or it might be an addressing problem.

Regardless, as of yet, you haven't managed to contact the AS/400 on the appropriate port. Until the route is proven, there's nothing that can be done for your VB programming.

Tom
0
 

Author Closing Comment

by:esemmoc
ID: 37777902
Thank you for questioning my assumption about connecting to the system.  Using Command.system.Signon() helped me determine that I wasn't.

Turns out I was using the wrong IP address.   That and a little cleanup of the CHGUSRPRF statement and it is now working good.
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
Multiple file Upload asp.net 2 38
Unable  to create new object 9 38
Recommendation vb6 to vb.net or others 14 109
More on Time zones in vb 2010 12 37
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The DROP (Spamhaus Don't Route Or Peer List) is a small list of IP address ranges that have been stolen or hijacked from their rightful owners. The DROP list is not a DNS based list.  It is designed to be downloaded as a file, with primary intention…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

24 Experts available now in Live!

Get 1:1 Help Now