http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=38523
使用ADO連結EXCEL時發現一個問題
就是,若該欄位整欄皆為數字或皆為文字時...則欄位讀取正常
但是,若某欄位之各筆資料有文字與數子時...則數字欄位值會不見
[ANS]
在ADOConnection的ConnectingString裡多加上 IMEX=1 即可
參考資料:
http://www.connectionstrings.com/
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
"HDR=Yes;" indicates that the first row contains columnnames, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text