Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006

    Unanswered: Pb with ADO and DB2 CCSID field


    I have a problem when getting data with ADO on string fields. The returned field value is blank when CCSID is 65535. Here is an example of the source code in which MyString is set to blank :

    Dim AS400 As ADODB.Connection
    Dim SqlString As String
    Dim MyFile As ADODB.Recordset
    Dim MyString as string

    Set AS400 = CreateObject("ADODB.Connection")
    Set MyFile = CreateObject("ADODB.recordset")

    AS400.Open "provider=IBMDA400;data source=D02;User ID=THETHING;password=xdsklzef"
    MyFile.ActiveConnection = AS400
    SqlString = "select * from A01SPEDTA.F55421B where RMIVD = 106270"
    MyFile.Open SqlString

    MyString = MyFile.Fields("RMKCOO")

    I fear it has something to do with CCSID 65535 which is not converted.
    Can you help ?


  2. #2
    Join Date
    Jun 2006


    if this is a drda connection from windows or other : this ccsid is not supported
    this is old/known problem. beacuse this ccsid used to be the default on as/400
    since 5.2 ccsid 500 is the default. but db created before is having this ccsid
    if drda connections are needed, it is recommended to migrate the files to new cssid
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Dec 2006

    Solution for ADO DB2 CCSID 65535 fields

    Hello Guy.

    I finally fixed the problem yesterday after reading the IBM iSeries Access Developper Toolbox documentation. In fact, CCSID 65535 is used to avoid any conversion and that is the reason why I can't get my data properly (it's in binary or hexadecimal format). But there is a very easy solution to bypass the problem and force the system to convert to any other CCSID, using the "Force Translate=<new CCSID>" parameter in the connection string :

    <connection>.Open "Provider=IBMDA400;Data Source=SystemA;Force Translate=0", "Userid", "Password")

    A value of 0 (zero) will force the conversion to the retrieved job CCSID of the iSeries signon server job during connection authentication.

    Christian Bufacchi.

Posting Permissions

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