Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IBM DB2 (VB6 / IBM AS400 )

    Quite a obscure one this, if anyone could point me to any relevant sites it would be appreciated.

    I have a VB6 application that is uploading some data to an AS/400 database via IBM Client Access. I'm using ADO 2.7 to create a connection to the database and create subsequent recordset objects.

    Before I start writing data to to file, I need to clear the contents. I can issue a...

    con400.Execute "DELETE * FROM AS400File"

    ...command which works but is extremely slow. I want to issue an AS400 system command CLRPFM which takes 2 parameters, LIBRARY & FILE. I'm unsure on the syntax for this, Client Access accepts a keyword CALL but I've tried a few obvious ones such as....

    con400.Execute "CALL CLRPFM(LIBNAME/FILENAME)"

    ...but with no joy. Has anyone had experience with this or knows any good sites for this info...?

    Thanks

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: IBM DB2 (VB6 / IBM AS400 )

    I searched the entire web, and all I found was this:

    4.7 How to execute remote command through ODBC ?

    Sub ExecuteCmdExample()
    ExecuteAS400Cmd "CLRPFM MYLIB/MYFILE"
    End Sub

    Sub ExecuteAS400Cmd(strCmd As String)
    dbAS400.Execute ("CALL QSYS.QCMDEXC('" & strCmd & "', " & Format(Len(strCmd), "0000000000") & ".00000)")
    End Sub

    http://www.geocities.com/Hollywood/Lot/8476/AS400/#4.7

    Does that mean anything to you?

  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IBM DB2 (VB6 / IBM AS400 )

    That looks great - CLRPFM is actually executed by another AS/400 program (QSYS.QCMDEXC), I was stuck on the syntax to pass to the program tho...
    Many thanks, if it works I'll post back here....

  4. #4
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IBM DB2 (VB6 / IBM AS400 )

    It only works! Thanks very much, it saves so much time....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •