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

LVL 9
AsishRajAsked:
Who is Participating?
 
AsishRajConnect With a Mentor Author Commented:
I managed to get it working using below call

CALL QSYS.QCMDEXC('chgcurlib curlib(imassogo)',0000000026.00000)
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
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: http://www.experts-exchange.com/M_4382324.html
0
 
AsishRajAuthor Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.