将访问查询导出到文本文件换行

发布于 2024-08-29 12:31:49 字数 108 浏览 4 评论 0原文

我正在为将导出到文本文件的 Access 数据库创建 SQL 查询。这些要求包括分隔每行的换行符。这是默认情况下发生的,还是我需要添加的内容? 如果我需要添加它,我该怎么做?

TIA

I am creating a sql query for an access database that will be exported to a text file. The requirements include a line feed separating each line. Does that happen by default, or its something that I need to add in?
If I need to add it, how do I do that?

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吻风 2024-09-05 12:31:49

TransferText 包括换行,我相当确定从 Access 中获取文本的大多数方法都将包括换行,除非您采取措施阻止它。检查起来并不太困难。

Dim fs As New FileSystemObject

s = "c:\docs\test.txt"
DoCmd.TransferText acExportDelim, , "query6", s
Set f = fs.OpenTextFile(s)
a = f.ReadAll

''Split at linefeed: Chr(10)
aa = Split(a, Chr(10))

''Test 1
Debug.Print UBound(aa)

''Test 2
For Each itm In aa
    Debug.Print itm
Next

TransferText includes LineFeed and I am fairly sure most methods of getting text out of Access will include linefeed, unless you do something to stop it. It is not too difficult to check.

Dim fs As New FileSystemObject

s = "c:\docs\test.txt"
DoCmd.TransferText acExportDelim, , "query6", s
Set f = fs.OpenTextFile(s)
a = f.ReadAll

''Split at linefeed: Chr(10)
aa = Split(a, Chr(10))

''Test 1
Debug.Print UBound(aa)

''Test 2
For Each itm In aa
    Debug.Print itm
Next
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文