将MS Access查询导出到CSV文件 [英] Export MS Access Query to CSV File

查看:287
本文介绍了将MS Access查询导出到CSV文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在将查询导出到csv文件时遇到了麻烦。我能够使用doCMD.TransferText将查询输出到csv文件,但是,我无法使用导出规范,并且在某些查询中数据显示在看起来像HEX的内容中。下面是一个例子:


Invoice_Header的SQL语句查询:

Hello, I''m having some troubles exporting a query to a csv file. I am able to use the doCMD.TransferText to output the query to the csv file, however, I cannot get it to use the Export Specifications and on some queries data is showing up in what looks like HEX. Below is an example:

SQL Statement for Invoice_Header Query:

展开 | 选择 | Wrap | 行号

推荐答案


我的第一个问题是:为什么我的两个参数以HEX(?)格式显示?我怎么阻止它。
My first question is: Why are my two parameters showing up in HEX(?) format? And how do I stop it.



这是两个问题!


1)它显示了这种方式,因为它正在导出正确的Unicode格式的数据。如果你丢失了空格并将十六进制转换为字符数据,你会注意到与预期输出的相似性。


2)我不确定。尝试查找数据库中指定数据管理方式的设置。它甚至可能是Windows设置。很抱歉对此毫无希望,但我总是确保我从不使用Unicode,所以我很少遇到这个问题。

That''s two questions!

1) It is showing that way because it''s exporting the correct data in Unicode format. If you lose the nulls and convert the Hex to character data you will notice the similarity to your expected output.

2) I''m not sure. Try looking around for settings in the database that specify how data is managed. It may even be a Windows setting. Sorry to be so hopeless on this, but I always ensure that I never use Unicode so I rarely come across this problem.



第二个问题是的,我想将文本quallifier设置为{none},因为可以在高级导出设置框中完成。我这样做并将导出规范保存为Export1。当我使用Export1作为规范运行我的导出命令时,出现错误:

正在导出的数据与Schema.ini文件中描述的格式不匹配。我已经在微软知识库中读过这个文件了,但是我无法在任何地方的计算机上找到它。
Second question is, I want to set the text quallifier as {none} as can be done in the advanced export settings box. I did this and saved an export specification as Export1. When I run my export command with Export1 as the specification, I get an error:
"The data being exported does not match the format described in the Schema.ini file." I''ve read about this file a little bit in Microsofts KB, but I can''t find it on my computer anywhere.



我不确定这个。它发生在我身上,虽然它可能与Unicode问题有关。


首先解决这个问题然后再看一下如果它仍然是一个问题。

I''m not sure about this one. It occurs to me though that it may be related to the Unicode problem.

Get that resolved first then have another look at this if it is still a problem then.


感谢您提供的信息。不确定如何继续unicode问题。


我发现的另外一点信息:

我有两个查询生成基本相同的结果集。不同之处在于其中一个表达式使一个字段为负。然后将这两个查询作为联合运行,以生成包含正值和负值的集合。目的是当结果csv导入另一个系统时,负值将记录在一个部分中,而正值则记录在另一个部分中。但是,我的观点是导出联合查询会从显示和导出为文本的表单中重新调整我的参数。如果我导出其中一个组件查询,则它们具有unicode。这有什么意义吗?我们可以使用这些信息来修复其他信息吗?


以下是SQL语句:
Item_Lot_Summary_InvoiceDistributions_Minus_Query
Thanks for the information. Not really sure how to proceed with the unicode issues.

One further bit of information I have found:
I have two queries that generate basically the same result set. The difference is that one of them has an expression to make one field negative. These two queries are then run as a union to generate a set that contains a positive and negative value. The purpose is that when the result csv is imported into another system, the negative values will be recorded in one section and positives in another. But, my point is that exporting the union query resullts in my parameters from the form displaying and exporting as text. If I export either of the component queries they have the unicode. Does this make any sense and could we use this information to fix the others?

Here are the SQL statements:
Item_Lot_Summary_InvoiceDistributions_Minus_Query:
展开 | 选择 | Wrap | 行号


这篇关于将MS Access查询导出到CSV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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