从Access导出CSV文件时不带双引号 [英] Export CSV file from Access without double quotes

查看:340
本文介绍了从Access导出CSV文件时不带双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Access 2010将表Final2导出为CSV文件. 生成的CSV文件带有引号.如何从CSV文件中删除引号?

I'm trying to export a table Final2 as a CSV file from Access 2010. The CSV file generated has quotation marks. How do I remove the quotes from the CSV file?

我尝试使用ImportExport Text宏,该宏的VBA代码如下所示:

I tried using the ImportExport Text macro, the VBA code for the macro looks like below:

Function Output_to_csv_macro()
On Error GoTo Output_to_csv_macro_Err

    DoCmd.OpenQuery "abc", acViewNormal, acEdit
    DoCmd.OpenTable "Final2", acViewNormal, acEdit
    DoCmd.TransferText acExportDelim, "", "Final2", "C:\Users\Output file.csv", True, ""
    DoCmd.Close acTable, "Final2"


Output_to_csv_macro_Exit:
    Exit Function

Output_to_csv_macro_Err:
    MsgBox Error$
    Resume Output_to_csv_macro_Exit

End Function

推荐答案

没有导出规范的DoCmd.TransferText总是将引号放入其中.如果要不使用引号,则首先需要设置导出规范,然后在您的代码中引用该规范.

The DoCmd.TransferText without an export specification will always put the quotes in. If you'd like to do it without, you first need to set up an export specification, then reference that specification in your code.

这篇关于从Access导出CSV文件时不带双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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