Hi there,
I'm trying to get data from AS/400. When I execute this SQL line in AS/400 I'll get proper data (= proper data in both colmuns). When I execute that code from MS Access VBA the first columns shows as question marks '?????'.
The SQL in AS/400 (STRSQL) is like this:
SELECT DRKY, DRDL01 FROM JLSFSP73.F0005 where DRSY='58 ' AND DRRT='WS'
The code in MS Access looks like this:
-----<code start>-----
Sub TestThis()
Dim myCnn As ADODB.Connection
Dim myRs, myRs2 As ADODB.Recordset
Set myCnn = New ADODB.Connection
myCnn.Open "Driver={Client Access ODBC Driver (32-bit)};System=mySystemName;UID=myUserID;PWD=myPwd"
Set myRs = New ADODB.Recordset
Set myRs.ActiveConnection = myCnn
myRs.Open "SELECT DRKY, DRDL01 FROM JLSFSP73.F0005 where DRSY='58 ' AND DRRT='WS'"
myRs.MoveFirst
Do Until myRs.EOF
Debug.Print myRs!drky & " " & myRs!drdl01
myRs.MoveNext
Loop
myRs.Close
Set myRs = Nothing
myCnn.Close
Set myCnn = Nothing
End Sub
-----<code end>-----
And the result looks like this:
????? LAMINOITU LASI
????? IKKUNALASI
????? IKKUNALASI KEHYKSILL#
????? KIERR#TYSKERAMIIKKA
(The # characters in second column are scandinavian characters which have translated into # characters)
In DB2 field DRKY is CHAR 10 with CCSID=65535 and field DRDL01 is CHAR 30 with CCSID=37.
I have tried changing the connection string so that it has CCSID=37 at the end (and other values too) with no help. Only the data in second column has changed.
I figured that this is a connect string issue, am I right? Anyone?
-V-