[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.

转载于:https://www.cnblogs.com/brucenan999/archive/2008/10/13/1309725.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值