TransferText丢弃分数 [英] TransferText dropping fractions

查看:94
本文介绍了TransferText丢弃分数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个csv,我试图通过adp(Access 2000)导入到SQL Server(2000)

表中。使用的表单为用户提供了浏览文件的能力,然后将文件导入temp

表,以便使用此vba代码进行处理:


DoCmd.TransferText acImportDelim ,," tmpPaTimeClock2",Me!TimeFileName,

False


当我运行导入时代码,导入任何

值小于1(显然)。我有几个专栏

的价值为.5,但这些是0。小数位

正在进口(例如532.28)是正确的523.28)


我试过改变临时表中的数据类型,但这并不是
似乎有所作为。

我试过让导入创建一个新表,但这并没有解决问题

问题。


如果我直接通过adp导入文件(右键单击 - 导入)

所有值都正确输入。


任何人都知道如何解决这个问题,还是另类?我在

bcp和批量复制上做了一些阅读,但我看不出一个简单的方法来允许该文件的

变量路径名。

I''ve got a csv that I am trying to import into a SQL Server (2000)
table through an adp (Access 2000). The form used gives the user the
ability to browse for a file, then will import the file into a temp
table for processing using this vba code:

DoCmd.TransferText acImportDelim, , "tmpPaTimeClock2", Me!TimeFileName,
False

When I run the import through the code, the import is dropping any
values less than one (apparently). I''ve got a couple of columns that
have .5 for the value, but these are brought in as 0. Decimal places
are being imported (ex. 532.28 comes in correctly as 523.28)

I''ve tried changing the datatype in the temp table, but that doesn''t
seem to make a difference.
I''ve tried letting the import create a new table, but that doesn''t fix
the problem either.

If I import the file directly through the adp (right click - import)
all of the values are brought in correctly.

Anyone know how to fix this, or an alternative? I did some reading on
bcp and Bulk Copy, but I couldn''t see an easy way to allow for the
variable path name to the file.

推荐答案

您是否尝试使用已定义数据的已保存导入规范?


-

Danny J. Lesandrini
dl ********* @ hotmail.com
http://amazecreations.com/datafast

< ck **** @ mindspring.com>写了...
Have you tried using a saved import spec with the data typ defined?

--
Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
<ck****@mindspring.com> wrote ...
我有一个csv,我试图通过adp(Access 2000)导入到SQL Server(2000)表中。使用的表单使用户能够浏览文件,然后将文件导入临时表格,以便使用此vba代码进行处理:

DoCmd.TransferText acImportDelim ,,,tmpPaTimeClock2,Me!TimeFileName,False
I''ve got a csv that I am trying to import into a SQL Server (2000)
table through an adp (Access 2000). The form used gives the user the
ability to browse for a file, then will import the file into a temp
table for processing using this vba code:

DoCmd.TransferText acImportDelim, , "tmpPaTimeClock2", Me!TimeFileName, False



Danny'可能比我在这里更接近球,但是在尝试之后/>
他的建议我会考虑将你的一些.5值改为0.5

并看看它们是如何导入的。

Danny''s probably closer on the ball than I am here, but after trying
his suggestion I would consider changing some of your .5 values to 0.5
and seeing how they import.


当我定义

one时,我似乎无法保存导入规范。我假设只有在处理

和.mdb时才能保存导入规范。不过我可能错了。

I don''t seem to get the option to save the import spec when I define
one. I assumed that import specs can only be saved when dealing with
and .mdb. I could be wrong on that though.


这篇关于TransferText丢弃分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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