Chgcurlib from

Posted on 2009-12-29
Last Modified: 2013-11-26
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






Open in new window

Question by:AsishRaj
    LVL 34

    Expert Comment

    by:Gary Patterson
    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:
    LVL 9

    Author Comment

    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
    LVL 9

    Accepted Solution

    I managed to get it working using below call

    CALL QSYS.QCMDEXC('chgcurlib curlib(imassogo)',0000000026.00000)

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now