目前許多客戶分別轉換系統big5 to utf-8, 自製VB6.0 轉檔工具出現問題.
經測試自製vb6.0轉檔工具可正確轉入SQL, Access.
唯獨有Excel出現不支援utf-8字元,很困擾...
改寫成C#是OK的,google不到解決之道!!!
一想到要將一堆工具改寫成C#...大工程呢!!!
多方測試、苦思不解...
發現oledb 引擎不同...測看看!!!
原Excel連結字串為:
"Provider=MSDASQL.1;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + ...
改寫為:
"Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=""Excel 8.0"";Data Source=" + ...
成功了!!!不用改寫啦!!!
經測試Oracle的連結字串也一樣 :
ODBC utf-8有問題:
"DSN=" & DSNname & ";UID=" & UID.Text & ";PWD=" & Pwd.Text
改成oledb utf-8 OK!
"Provider=OraOLEDB.Oracle.1;Password=" & Pwd.Text & "Persist Security Info=False;User ID=" & UID.Text & ";Data Source=" + ...