如果列中的所有值都以“S”开头,ADO会从列值中删除前导字符“S” [英] ADO strips leading character 'S' from column values if ALL values in column start with 'S'

查看:88
本文介绍了如果列中的所有值都以“S”开头,ADO会从列值中删除前导字符“S”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么ADO(Jet.OLEDB.4.0)在导入csv / txt文件时...从列值中删除前导字符"S"?

why does ADO (Jet.OLEDB.4.0) when importing a csv/txt file ... remove the leading character 'S' from the column values?

if我在单个列中的所有值都以S开头,其余的字符是数字字符,例如S12345,S5677 ...导入删除了前导'S'字符,因此导入12345,5677,

if all my values in a single column start with S and the remaining characters are numeric characters e.g. S12345, S5677 ... the import removes the leading 'S' character, so imports 12345, 5677,

但如果列中的单个值不以''开头S',例如1235S ...然后列中的所有值都被导入OK(前导S未被删除)

BUT if a single value in the column does not start with 'S', e.g. 1235S ... then all values in the column are imported OK (the leading S is not removed)

这使我相信一个主角'S'必须具有特殊含义。 ..例如'import as string'...这样S1245将被导入为字符串值1245(而不是数字?)

This leads me to believe that a leading character 'S' must have a special meaning ... such as 'import as string' ... so that S1245 will be import as the string value 1245 (rather than as a number?)

但我找不到任何文件来确认这(广泛搜索网)

But I cannot find any documentation to confirm this (having searched the net extensively)

有解释吗?

Tracey

推荐答案

如果您要提供有关如何进行导入的详细信息,可能会有所帮助。

It would probably help if you were to provide details of how you are doing the import.

如果有一种方法可以为每列指定数据类型,并且如果没有明确指定数据类型,那么它似乎在猜测数据类型。如果猜错了,那么你需要明确指定类型。

If there is a way to specify a data type for each column and if you are not specifying the data type explicitly then it seems to be guessing at the type of data. If it guesses wrong then you need to specify the type explicitly.


这篇关于如果列中的所有值都以“S”开头,ADO会从列值中删除前导字符“S”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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