将数据导出为预格式化的文件 [英] Exporting data into a pre-formatted file

查看:146
本文介绍了将数据导出为预格式化的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Access 2007,我希望使用'。'分隔符将数据导出到文本文件中。我似乎没有任何运气找到答案,所以我想知道是否可能有一个预格式化的文本或CSV文件,它会导出我的数据,所以我可以有我的'。'分隔符。

解决方案

使用schema.ini文件



在MS Access中

  Sub TransferData()
'假设文件退出
杀死z:\docs\export.txt
CurrentDb.Executeselect * into [text; database = z:\docs\]。[export.txt] from table1
End Sub
/ pre>

Schema.ini文件必须位于用于导出的目录中:

  [export.txt] 
格式=分隔(。)
DecimalSymbol =,

更多信息: Schema.ini


I am using Access 2007 and I wish to export my data into a text file with a '.' separator. I don't seem to have any luck finding an answer so I wondering if it were possible to have a pre-formatted text or CSV file that it would export my data into so I could have my '.' separators.

解决方案

Working with a schema.ini file

In MS Access

 Sub TransferData()
    'Assuming file exits
    Kill "z:\docs\export.txt"
    CurrentDb.Execute "select * into [text;database=z:\docs\].[export.txt] from table1"
 End Sub

The Schema.ini file, which must be in the directory that is used for the export:

[export.txt]
Format=Delimited(.)
DecimalSymbol=,

More information: Schema.ini

这篇关于将数据导出为预格式化的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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