There is a small program with a MySQL database, in the Chinese garbled this piece made the day more confused, the result was put down. These two days there is a dream in research, the results are also made right, hehe.
Previous steps after installing MySQL, the configuration of the selection of MySQL Server Instance Config Wizard-> detail option was selected at the time of the code for GB2312, do not know why there are garbled.
This time, a different step:
1. Install MySQL 5.1, do not have MySQL Server Instance config Wizard configuration, choose stand option to configure. After entering the MySQL display Chinese garbled, insert Chinese garbled set names gb2312 after the solution.
2. Install MySQL ODBC 5.1.
3. Install MySQL Front for connection character Set selection gb2312 colaction select Gb2312_chinese_ci.
When you create a table, you use gb2312 to encode the field.
<%
Set Conn=server.createobject ("Adodb.connection")
connectionstring= "Driver={mysql ODBC 5.1 driver};d atabase=mysql;server=localhost;uid=root;password=abc;opt=3;smt= SET NAMES ' gb2312 '
Conn.Open ConnectionString
Set Rs=server.createobject ("Adodb.recordset")
Rs.Open "Select from Testme", conn,1,1
While not rs.eof
Response.Write RS ("username")
Rs.movenext
Wend
Rs.close
Set rs=nothing
Sql= "INSERT into Testme (username) VALUES (' China ')"
Conn.execute SQL
%>
This will not appear garbled.