If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Pb with ADO and DB2 CCSID field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-26-06, 11:59
bufacchi bufacchi is offline
Registered User
 
Join Date: Dec 2006
Posts: 2
Pb with ADO and DB2 CCSID field

Hello.

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 ?

Christian.
Reply With Quote
  #2 (permalink)  
Old 12-27-06, 09:58
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
ccsid

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
Reply With Quote
  #3 (permalink)  
Old 12-28-06, 03:34
bufacchi bufacchi is offline
Registered User
 
Join Date: Dec 2006
Posts: 2
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.

Thanks,
Christian Bufacchi.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On