Link to home
Start Free TrialLog in
Avatar of AsishRaj
AsishRajFlag for Fiji

asked on

Chgcurlib from VB.net

Hello Experts

when i run the below code it errors out.  it gives me error SQL0104.

i have been able to call RPG programs but i am not successfull in changing the library.
Dim myAS400OleDbConnection As New OleDbConnection("Provider=IBMDA400;Data Source=IP;User Id=UID;Password=PWD;")

            Dim myAS400OleDbCommand2 As New OleDbCommand
            Dim Cha As String = "Call Qsys.chgcurlib LibName"

            myAS400OleDbCommand2.Connection = myAS400OleDbConnection
            myAS400OleDbCommand2.CommandText = Cha

            myAS400OleDbConnection.Open()
            MsgBox("OPen")

            myAS400OleDbCommand2.ExecuteNonQuery()

            myAS400OleDbConnection.Close()
            MsgBox("Success")

Open in new window

Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

CHGCURLIB is a command, not a program.  You don't CALL commands (actually "CALL" is a command), you invoke them directly.

Try this:

Dim Cha as String = "CHGCURLIB libname"

- Gary Patterson

Check out my EE profile: https://www.experts-exchange.com/M_4382324.html
Avatar of AsishRaj

ASKER

Hello Gary

Thank for responding. i have already tried what you suggested but same problem.

i have tried
Dim Cha As String = "Call Qsys.chgcurlib imassogo"
Dim Cha As String = "Call chgcurlib imassogo"
Dim Cha As String = "Qsys.chgcurlib imassogo"
Dim Cha As String = "chgcurlib imassogo"

But none works
ASKER CERTIFIED SOLUTION
Avatar of AsishRaj
AsishRaj
Flag of Fiji image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial