Importing from Excel - non-numeric values are ignored

那年仲夏 提交于 2019-12-01 19:38:19

By default Excel bases the data type for a column on the first 8 rows of data. To change this, you need to update the registry key:

HKLM\Software\Microsoft\Office\12.0\Access Connect Engine\Engines\Excel

with the number of rows you want Excel to scan. Set the value to 0 to have it scan all the rows. Note that setting it to zero can slow the Excel loads down a bit, especially on large spreadsheets.

Also, if you are also using Excel 2003, you need to update a second registry key:

HKLM\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel

What I have noted is that the Engine infers the data type of the column from the first value in the column.

So, if your first value is numeric, the engine will assume the column as numeric and when trying to convert a alpha value to numeric will fail.

What i Have usually done is append an underscore to all the values on Excel, and then, up on SQL or on DataSet, to make the replace of the first underscore. Hope it will helps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!