导入Excel错误,ODBC和schema.ini [英] Importing Excel errors, ODBC and schema.ini

查看:190
本文介绍了导入Excel错误,ODBC和schema.ini的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何克服导入Excel文件错误?错误确定数据类型是因为尚未扫描足够的文件.

How can you overcome importing excel file errors? When the datatype is incorrectly determined it is because enough of the file has not been scanned.

txt和csv文件,您可以设置schema.ini和/或将整个文件扫描到末尾. 此MSDN参考

txt and csv files you can set a schema.ini and/or have the whole file scan to the end. This MSDN reference says

MAXSCANROWS 根据现有数据设置列的数据类型时要扫描的行数. 可以输入1到16之间的数字以进行扫描.该值默认为8.如果将其设置为0,则将扫描所有行. (超出限制的数字将返回错误.) 这将在设置对话框中设置与要扫描的行"相同的选项.

MAXSCANROWS The number of rows to be scanned when setting a column's data type based upon existing data. A number from 1 to 16 can be entered for the rows to scan. The value defaults to 8; if it is set to 0, all rows are scanned. (A number outside the limit will return an error.) This sets the same option as Rows to Scan in the setup dialog box.

如果我将扫描的行设置为0,则会抛出一个错误,提示要扫描的行无效" 重新阅读此内容后,我看到范围在1-16之间,并且由于0超出了该范围,因此无法像使用csv或txt文件一样进行完整的扫描.

If I set the rows scanned to 0 an error is thrown saying "Invalid rows to scan" After re-reading this, I see the range is between 1-16 and since 0 is outside that range I can't get a complete scan, as I could with a csv or txt file.

问题是当为客户端导入sku id时,文件顶部出现数字的某些数据会导致对数据类型的误解. 如果可以在excel文件上使用schema.ini,那将是很棒的. 没有办法克服循环遍历每个单元格并将字符串包装在"中的这种不足吗?

The issue is when importing sku ids for clients, some data appearing numeric at the top of a file causes a misinterpretation of the datatype. If a schema.ini could be used on excel files that would be wonderful. Is there no way to overcome this short of looping through every cell and wrapping the string in ""?

推荐答案

如果能够将文件转换为csv,则可以使用建议类型"功能更轻松地导入文件,该功能可让您扫描x文件中的每一行,并为每一列选择最合适的数据类型.

If you are able to convert the file to csv, you will have an easier time importing it using the 'Suggest Types' feature which allows you to scan through x rows in your file and pick the most appropriate data type for each column.

这篇关于导入Excel错误,ODBC和schema.ini的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆