Home > Software engineering >  Vb 6.0 using ado to connect the mysql database VSFlexGrid1 field name the code shown in the table
Vb 6.0 using ado to connect the mysql database VSFlexGrid1 field name the code shown in the table

Time:09-28






In the table according to the normal, the great god help the field name the code modification to come over

CodePudding user response:

Your mysql database/table of coding and fields do not match the code, change the database encoding the mysql database, field coding and table coding
Had better use English field, and then in the query is used in the SELECT clause, alias way to turn the column names in Chinese,
Or a reference to create the mysql database in the code, can try by setting the option to change,

CodePudding user response:

Thank you for your reply, database, table, field name of the character set are utf8, and convenience of the field name in Chinese, I don't know is there any other way?

CodePudding user response:

Field name changed to es, query to give Chinese name:

SELECT user_name AS user name, sex AS gender and age AS age FROM sometable

CodePudding user response:

After connecting to the database is not something we can use the SET NAMES utf8 specify the code?

CodePudding user response:

StrCn="DRIVER={5.3 ANSI MySQL ODBC DRIVER};" & _
"SERVER=" & amp; Db_host & amp; ";" & _
"The DATABASE=" & amp; Db_data & amp; ";" & _
"UID=" & amp; Db_user & amp; "; The PWD="& amp; Db_pass & amp; ";" & _
"OPTION=3; The SET NAMES utf8 "
3 4 floor methods are tried, VSFlexGrid1 title garbled question didn't change to come over, thanks!

CodePudding user response:

The database is equal to the name of the database directly
  • Related