gerald m
2010-03-23 04:38:47 UTC
I am trying to insert unicode (ex. Russian characters ) text into a mysql database. The content got replaced as question marks (????) after inserting into db.
Programming Language : Visual Basic 6.0
Mysql DB : 4.0.26
Myodbc Version: 3.51
OS: Windows XP
Following is the code:
dim sContent as string
dim cn as new ADODB.connection
sContent="русский язык"
cn.ConnectionString = "uid=root;pwd=;server=localhost;driver={MySQL ODBC 3.51 Driver};charset=utf8;"
cn.Open
cn.Execute ("use testing")
cn.Execute ("SET CHARACTER SET utf8")
cn.Execute "SET NAMES utf8"
cn.Execute ("SET SESSION collation_connection ='utf8_unicode_ci'")
cn.Execute "insert into table_name values ( '" & sContent & "')"
If i type the same insert query in any DB interfaces(PhpMyadmin/Mysql control center) the value got inserted successfully.
Please help me to sort this issue.
Thanks,
Gerald Manickam