有效地将表传输到文本文件 [英] Efficient transfer of a table to text file
问题描述
我在Access(250,000行以上)中有一个表,我需要使用TAB作为分隔符和大陆号格式发送到分隔文本文件(我的数据有9,999.99,我需要输出9999,99) 。我已经使用FileSystemObject编写代码来写字段名称
然后滚动文件写入字段并将数字转换为正确的格式。但它永远需要。我相信在遥远的过去,我已经看到了一种使用ADO连接到文本文件并输出记录集的方法。
I have a table in Access (250,000 lines plus) that I need to send to a delimited text file using TAB as the delimiter and continental number format ( my data has 9,999.99 and I need to output 9999,99). I have written code using FileSystemObject to write out the field names then to scroll through the file writing the fields and converting the numbers to the right format. But it takes for ever. I am sure in the distant past I have seen a way of using ADO to connect to a text file and output a recordset.
有人能指出我正确的方向吗?
Can anyone point me in the right direction?
谢谢
ADG
推荐答案
我没有这样做,所以我不知道这是否有效。 我知道ADODB.Stream可以读取记录,ADODB.Stream可以写入文本文件。 我不确定它如何处理完整的记录集。 在SQL中,您可能需要使用TABS
而不是普通的SQL语句创建字符串。 让ACCESS完成大部分工作。 我发现它比使用VBA快得多。
I have not done this so I don't know if this works. I know ADODB.Stream can read a record and ADODB.Stream can write a text file. I am not sure how it handles a complete recordset. In the SQL you may need to create the string with TABS rather than a normal SQL statement. Have ACCESS do most of the work. I have found it much faster than using VBA.
这篇关于有效地将表传输到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!