如何将SQL查询(MS ACCESS)的结果导出为文本文件(.txt) [英] How do I export the result of SQL query(MS ACCESS) as a text file (.txt)

查看:138
本文介绍了如何将SQL查询(MS ACCESS)的结果导出为文本文件(.txt)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人帮助我吗?我刚开始新工作5天。我被指派将SQL查询(MS ACCESS)的结果导出为由标题(字段名称)和行项目(结果列表)组成的文本文件(.txt),并指定它们之间的空格。我知道MS ACCESS可以导出文本文件,但他确实想要那种格式。在这种情况下,我真的不知道该怎么做。我不想被解雇。请帮帮我。



我的尝试:



出口使用导出功能区。

Does anyone help me ? I just start a new job for 5 days. I was assiged to export the result of SQL query(MS ACCESS) as a text file (.txt) that consist of header (filed name) and line items (list of results) and specify the space between each of them. I know that MS ACCESS can export text file but he does want that format. In this case, I dont really know what to do. I dont want to be fired. please help me.

What I have tried:

export by using export ribbon.

推荐答案

这很容易做一些工作。如果你自己不能这样做,你就不会长时间从事这项工作。



这只是3个简单的步骤。构建并执行查询以返回结果集。



迭代返回的记录(对于某种循环)并从返回的结果集中获取下一条记录。



从记录中获取每个字段的值并对其进行格式化,并将字段以所需格式写入文件。





话虽如此,如果您认为帮助您意味着有人要为您编写代码,那么您已经被解雇了。
This is very easy to do with a bit of work. If you can't do this yourself, you're not going to be in this job for very long.

This is just 3 simple steps. Build and execute the query to return a result set.

Iterate over the records returned (for loop of some kind) and get the next record from the returned result set.

Get the value from each field from the record and format it and write the fields to the file in the format required.


Having said that, if you think "helping you" means someone is going to write the code for you, you're already fired.


这篇关于如何将SQL查询(MS ACCESS)的结果导出为文本文件(.txt)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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