[zz]A problem when reading data from Excel

Read data from one column, Excel will check first 8 rows (Default Value)'s format. If first 8 rows are number, and row 9 is string, the string value will missing.

1. Add "IMEX=1" to connection string. 2. Change the key value in register.

Details: Check the following registry settings for the *machine*:

Hkey_Local_Machine/Software/Microsoft/Jet/4.0/Engines/Excel/TypeGuessRows Hkey_Local_Machine/Software/Microsoft/Jet/4.0/Engines/Excel/ImportMixedTypes

TypeGuessRows: setting the value to 0 (zero) will force ADO to scan all column values before choosing the appropriate data type.

ImportMixedTypes: should be set to value 'Text' i.e. import mixed-type columns as text:

Using IMEX=1 in the connection string (as you have done) ensures the registry setting is applied.

posted on 2008-10-13 10:03 布鲁斯南 阅读(116) 评论(0) 编辑 收藏

导航

<2008年10月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

公告

本博客所有文章版权归本人所有,不得转为商业用途. 如需转载,请注明来源. 作者保留所有权利.
致力于企业的信息化建设,办公自动化及数据仓库,商业智能,数据库以及各式报表开发.有意者请给我留言.
昵称:布鲁斯南
园龄:6年
粉丝:3
关注:0

搜索

 
 

常用链接

最新随笔

我的标签

随笔分类(8)

随笔档案(9)

相册

积分与排名

  • 积分 - 39553
  • 排名 - 2714

最新评论

阅读排行榜

评论排行榜

推荐排行榜

本博客所有文章版权归本人所有,不得转为商业用途. 如需转载,请注明来源. 作者保留所有权利.

Google PR? - Post your Page Rank with MyGooglePageRank.com