esemmoc
asked on
Problem running an AS400 command line from VB.NET
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.De faultSyste m)
Command.system = YOUR400
' Enter USERID and PWD so the users will not be prompted
Command.system.Define("as4 00")
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
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.De
Command.system = YOUR400
' Enter USERID and PWD so the users will not be prompted
Command.system.Define("as4
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Turns out I was using the wrong IP address. That and a little cleanup of the CHGUSRPRF statement and it is now working good.
ASKER