我在EXCEL中写宏将AS400中的数据写到EXCEL中,但有汉字的字段导出的内容是乱码下面是我写的代码,有哪位知道应该怎么改才不会出现乱码?谢谢!Sheet1.Cells.clearSheet1.Cells(1,1).Value...
我在EXCEL中写宏将AS400中的数据写到EXCEL中,但有汉字的字段导出的内容是乱码
下面是我写的代码,有哪位知道应该怎么改才不会出现乱码?
谢谢!
Sheet1.Cells.clear
Sheet1.Cells(1, 1).Value = "AAAA"
Sheet1.Cells(1, 2).Value = "BBBB"
Sheet1.Cells(1, 3).Value = "CCCC"
Sheet1.Cells(1, 4).Value = "DDDD"
Sheet1.Cells(1, 5).Value = "EEEE"
'link as400
'CCSID = '65535'
Dim Conn As New ADODB.Connection
Conn.Open ("rovider=IBMDA400;Data Source=000.00.000.000;User id=XXXassword=XXX;QUOTE TYPE C 65535"
Dim rs As New ADODB.Recordset
Dim i As Integer
i = 2
Sql = "select * from LIB1.FILE1 where EEEE=12345"
rs.Open Sql, Conn, 1, 3