Google Answers Logo
View Question
 
Q: VBA Macros behind Excel -Character set conversion from unicode 65535 ( No Answer,   1 Comment )
Question  
Subject: VBA Macros behind Excel -Character set conversion from unicode 65535
Category: Computers > Programming
Asked by: micky1-ga
List Price: $5.00
Posted: 27 Sep 2002 06:35 PDT
Expires: 27 Oct 2002 05:35 PST
Question ID: 69679
I am accessing a database on the AS/400 through a VBA macro. This
database has a mixture of two character sets, 37 and 65535. If I use
the strcvtr.codepage=37 command, fields that are already character set
37 cause an error in VBA. I have tried using vbfromunicode command,
but have
had no luck. My fields get filled with the Capital 'O'. I can't find
any good examples of this anywhere. The
chr$,chrB etc. commands only deal with individual characters. Is there
a statement I can use that will bring all string fields selected in my
select statement in as one character set or the other?
Answer  
There is no answer at this time.

Comments  
Subject: Re: VBA Macros behind Excel -Character set conversion from unicode 65535
From: rac-ga on 26 Oct 2002 21:04 PDT
 
Hi,

Try this function StrConv(string, conversion)
This is the function in VBA to convert from different character sets.
Where string is the string to be converted and 
conversion is vbfromunicode.

I feel you are getting captial O in your result because your system
was not to set for correct code pages.
The following is the info about codepage in Windows help menu
Codepage--Notes

Codepage, keyboard, and country are interrelated. A code page is a set
of characters that are available to your system for use on the screen,
for printing, and for sending to any other sort of output device. Your
keyboard layout tells your system which characters from the character
set correspond to which keystrokes; this can be different from country
to country. The country you are working in (or for which you want to
set up your system) determines which two code pages you should use.
(For a list of country codes and their corresponding code pages, see
the country command.) You can change keyboard layouts without having
to change code pages.

You can set the codepage for your system using the country command in
config sys file.
For full details/syntax of setting out country and codepage refer
the helpmenu under topic codepage, country.

If you want to convert individual characters from unicode use ChrW
function.

Hope it helps.
RAC

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy