PDA

View Full Version : how to display Unicode Hindi characters into combobox from mysql database



vsprybhanu
10-12-2016, 06:36 AM
hi,

I have a mysql database where inserted some records in Unicode characters (Hindi).

I have designed a vba program to display all records of field 1 into combo box.

This program is running perfectly but the data is displaying "???????" in combo box because of it is in Unicode Hindi characters.

is there some one who give me a solution to display Hindi characters from MySQL database into combobox ?

I will be Grateful.

Thanks,

SamT
10-12-2016, 07:30 AM
From the help files:
Install the universal font for Unicode Arial Unicode MS font is a full Unicode (http://www.vbaexpress.com/forum/) font. It contains all of the characters, ideographs, and symbols defined in the Unicode 2.1 standard.

Note Because of its considerable size and the typographic compromises required to make such a font, Arial Unicode MS should be used only when you can't use multiple fonts tuned for different writing systems. For example, if you have multilingual data from many different writing systems in Microsoft Access, you can use Arial Unicode MS as the font to display the data tables, because Access can't accept many different fonts.



AscW(character) will return the Unicode number for the character.
ChrW(Ascii number) will return the Unicode Character represented by Ascii number.

If you have the Hindi Font installed, you can try setting the ComboBox Font to it.

vsprybhanu
10-12-2016, 08:09 AM
hi,
thanks to reply

I already used "Arial Unicode MS" font of Combo Box.

I am able to type in Hindi on Combo Box. And it will display correctly.

But when I retrieve data from MySQL database where Hindi data is stored then it will display "?????" on Combo Box.

I want to display data on combo in Hindi as it is on mysql.

SamT
10-12-2016, 10:15 AM
From MySQL 5.5 Help file

MySQL includes character set support that enables you to store data using a variety of character sets and perform comparisons according to a variety of collations. You can specify character sets at the server, database, table, and column level. MySQL supports the use of character sets for the MyISAM, MEMORY, NDBCLUSTER (https://dev.mysql.com/doc/refman/5.5/en/mysql-cluster.html), and InnoDB storage engines.


Character set issues affect not only data storage, but also communication between client programs and the MySQL server. If you want the client program to communicate with the server using a character set different from the default, you'll need to indicate which one. For example, to use the utf8 Unicode character set, issue this statement after connecting to the server:

SET NAMES 'utf8';



If applications require data storage using a different character set or collation, you can configure character set information several ways:

Specify character settings per database. For example, applications that use one database might require utf8, whereas applications that use another database might require sjis.
Specify character settings at server startup. This causes the server to use the given settings for all applications that do not make other arrangements.
Specify character settings at configuration time, if you build MySQL from source. This causes the server to use the given settings for all applications, without having to specify them at server startup.




The examples shown here assume use of the utf8 character set and utf8_general_ci collation.
Specify character settings per database. To create a database such that its tables will use a given default character set and collation for data storage, use a CREATE DATABASE (https://dev.mysql.com/doc/refman/5.5/en/create-database.html) statement like this:

CREATE DATABASE mydb
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;



Specify character settings at server startup. To select a character set and collation at server startup, use the --character-set-server (https://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_character-set-server) and --collation-server (https://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_collation-server) options. For example, to specify the options in an option file, include these lines:

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
These settings apply server-wide and apply as the defaults for databases created by any application, and for tables created in those databases.




A “connection” is what you make when you connect to the server. The client sends SQL statements, such as queries, over the connection to the server. The server sends responses, such as result sets or error messages, over the connection back to the client. This leads to several questions about character set and collation handling for client connections, each of which can be answered in terms of system variables:


What character set is the statement in when it leaves the client?
The server takes the character_set_client (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_character_set_client) system variable to be the character set in which statements are sent by the client.
What character set should the server translate a statement to after receiving it?
For this, the server uses the character_set_connection (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_character_set_connection) and collation_connection (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_collation_connection) system variables. It converts statements sent by the client from character_set_client (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_character_set_client) to character_set_connection (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_character_set_connection) (except for string literals that have an introducer such as _latin1 or _utf8). collation_connection (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_collation_connection) is important for comparisons of literal strings. For comparisons of strings with column values, collation_connection (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_collation_connection) does not matter because columns have their own collation, which has a higher collation precedence.
What character set should the server translate to before shipping result sets or error messages back to the client?
The character_set_results (https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_character_set_results) system variable indicates the character set in which the server returns query results to the client. This includes result data such as column values, and result metadata such as column names and error messages.


You can download the Reference manual at : http://dev.mysql.com/doc/ (http://dev.mysql.com/doc/)

vsprybhanu
10-12-2016, 07:16 PM
thanks for the reply again.

but my problem is different. there is no issue with server. I used collation as you describe. I already inserted Unicode data in MySql server and it shows correctly.

the problem is in Excel combo box. When I retrieve these data from MySql database to Excel Combo box then it shows "??????" on the combo.

so, problem is in excel combo not in mysql server.