导入制表符分隔的文本文件以访问数据库 [英] Import Tab delimited Text File to Access Database

查看:359
本文介绍了导入制表符分隔的文本文件以访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个制表符分隔的文本文件,并希望使用VBA代码将其导入MS Access.

I have a tab-delimited text file and want to import it in MS Access using VBA code.

我创建了一个MS Access表单,并使用了DoCmd.TransferText方法:

I have created an MS Access form and have used the DoCmd.TransferText method:

DoCmd.TransferText(TransferType, SpecificationName, TableName, FileName, HasFieldNames, HTMLTableName, CodePage)

它对于CSV文件非常有效.对于使用制表符分隔的文本文件,我不确定该怎么做.

It works well for CSV File. I'm not sure how to do it in case of tab-delimited text files.

有什么建议吗?

推荐答案

进行手动导入,将定界符更改为TAB,保存导入规范,然后在TransferText命令中指定该导入规范.

Do a manual import, changing the delimiter to TAB, save the import spec, and then specify that import spec in your TransferText command.

这篇关于导入制表符分隔的文本文件以访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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