This is because
Database Character Set, table character set, and field character set are all set to: gbk_chinese_ci
Note that stmt = set names 'gbk' in the database connection string must have this sentence.
Below is the ASP link to MySQLCode. Note that there is a GBK later. In this way, the encoding type of the link is specified. Based on your data
Library encoding type. Modify it to your own.
Connectionstring = "driver = {MySQL ODBC 3.51
Driver}; server = myserver; database = MySQL; user = myuser; Password = mypassword; option = 3; stmt = Set
Names 'gbk '"
If you use a higher version of MySQL, this often occurs, and Chinese characters are often garbled; including in PHP.
Reference Method:
Set the font of MySQL.
Add in MySQL. ini
[MySQL]
Default-character-set = gb2312
[Client]
Default-character-set = gb2312
[Mysqld]
Default-character-set = gb2312 // or GBK
After the registration is changed, the contents of the DB. Opt file under these database directories are changed
Default-character-set = gb2312
Default-collation = gb2312_chinese_ci
You can also do this.
Dim drivername, CHS
Drivername = "driver = {MySQL ODBC 3.51
Driver}; server = localhost; database = test; uid = loaer; Pwd = 123456 ;"
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open drivername
'Execute the following statement before querying
Set CHS = conn. Execute ("set names 'gb2312 '")
'Query database tables
SQL = "select * From tb_commondata"
Set rs = conn. Execute (SQL)
So there will be no garbled characters.