How to specify charset for queried data?

M

mirin

Hello,

Using VBA, I am running a query on a Sybase database and displaying
the results in an Excel sheet. I am using MS ADO 2.1 library. The
problem is that some fields which are in Japanese are being displayed
as junk. My PC does have Japanese language
support installed and I can read and write Japanese text in an Excel
sheet. But the Japanese part of the data returned from the Sybase
database displays as
junk. The database owners say the charset is 'EUC' code.

How can I set my results in Excel to be of charset 'EUC' for this
query?

Here's my VBA code:

'***
Dim connDB As ADODB.Connection
Dim rstDB As ADODB.Recordset

Set connDB = New ADODB.Connection
connDB.Open "Provider=MSDASQL.1;Extended
Properties=ODBC;DATABASE=database1;UID=user1;PWD=pswd1;DSN=DSN1;"

strSQL = "SELECT * FROM tbl1"

Set rstDB = New ADODB.Recordset
rstDB.Open strSQL, connDB, adOpenForwardOnly, adLockReadOnly

Sheet1.Range("A2").CopyFromRecordset rstDB
'***

Many Thanks,
Mirin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top