Link to home
Create AccountLog in
Avatar of PMS-ICT
PMS-ICT

asked on

Change as400 user profile status via VB

Hi,

I'm trying to use below code to execute and change as400 user profile status from a web page, But i'm getting a error message, can anyone help to fix this code,

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 = "qsecofr"
        Command.system.Password = "xxxxxx"
        Command.system.IPAddress = "xx.xx.xx.xxx"

        ' Run any valid 400 command from VB
        Command.Run("CHGUSRPRF USPRPF(user11) STATUS(*ENABLED)")

        Exit Sub
failed:
        MsgBox("AS/400 User Account Status Change Failed")
ASKER CERTIFIED SOLUTION
Avatar of Chad Smith
Chad Smith
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
What is the error?