要从Access导出的schema.ini文件 [英] schema.ini file to export from Access

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

问题描述

我正在通过VBscript从Access DB导出,并想尝试使用Schema.ini文件.我有一个批处理程序,它会触发一个vbscript文件,该文件会打开Access DB并进行导出.我的vbscript文件名是export.vbs.

如果我有

DoCmd.TransferText acExportDelim, "", "table", "C:\output\table.csv"

我注意到在导出过程中,会自动创建一个文件"export.ini".

如果我有

DoCmd.TransferText acExportDelim, "Schema.ini", "table", "C:\output\table.csv"

我在谈论文本文件规范'Schema.ini'不存在."时遇到错误,即使这一切都发生在同一个目录中,我在那里有一个Schema.ini文件.我缺少什么? /p>

谢谢!

解决方案

您需要以不同的方式进行操作(

I'm exporting from an Access DB via VBscript and want to try using a Schema.ini file. I have a batch program that fires off a vbscript file that opens the Access DB and does the export. My vbscript filename is export.vbs.

If I have:

DoCmd.TransferText acExportDelim, "", "table", "C:\output\table.csv"

I notice while the export is happening a file gets automatically created "export.ini".

If I have

DoCmd.TransferText acExportDelim, "Schema.ini", "table", "C:\output\table.csv"

I get an error talking about "The text file spec 'Schema.ini" does not exist." even though in the same directory this is all happening in I have a Schema.ini file there. What am I missing?

Thanks!

解决方案

You need to go about it a different way ( Create comma separated file (csv) from access - scheduled daily from windows )

Set cn = CreateObject("ADODB.Connection")

cn.Open "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=z:\Docs\test.accdb"

sSQL = "select * into " 
sSQL= sSQL & "[text;database=z:\docs\;FMT=Delimited;HDR=Yes].[csvfile.csv]"
sSQL= sSQL & " from table1"

cn.Execute sSQL

这篇关于要从Access导出的schema.ini文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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