SQL查询带有自定义文件扩展名的平面文件时出错 [英] Error when SQL-querying flatfiles with custom file-extension

查看:105
本文介绍了SQL查询带有自定义文件扩展名的平面文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种直接通过SQL使用自定义文件扩展名查询平面文件的方法.

I'm looking for a way to query flatfiles with custom file-extensions directly via SQL.

通常使用

SELECT * FROM [Text;DATABASE=C:\Flatfiles].[S7121070_ppis#csv]

与.txt,.csv和.tab完美结合.

which works terrific with .txt, .csv and .tab.

但是,在我当前的项目中,我使用带有.ftp7扩展名的固定宽度的平面文件.使用VBA查询这些文件时,遇到Err#-2147217911,表明对象或数据库已锁定.

However, in my current project I work with fixed-width flatfiles with an .ftp7-extension. When querying those files in with VBA, I encounter Err# -2147217911, stating that the object or database is locked.

奇怪的是,仅当我查询不是 .txt,.csv或.tab的任何内容时,才会发生这种情况.含义myfile.ftp7myfile.ftpmyfile.abcmyfile无法查询.

Oddly, this occurs only whenever I querying anything that's not a .txt, .csv or .tab. Meaning myfile.ftp7, myfile.ftp, myfile.abc or myfile can't be queried.

这不能完成吗?还是我只是想念一些东西?谢谢你的帮助! 干杯, 马丁

Can't this be done or am I simply missing something? Thanks for your help! Cheers, Martin

其他信息:

  • 我将Excel或Access与VBA一起使用
  • 将.ftp7重命名为.csv,.txt,.tab可以解决此问题,但是由于只读访问,因此不能执行
  • 我可以使用schema.ini-文件来描述数据结构,因此我希望实际的文件扩展名或多或少地对解释文件内容具有冗余性
  • I use either Excel or Access with VBA
  • Renaming .ftp7 to .csv, .txt, .tab solves the problem, but is a no-no due to read-only access
  • I can use a schema.ini-files to describe the data-structure, so i would have expected that the actual file-extension is more or less redundant for interpreting the files contents

推荐答案

作为Fionnuala的帖子:

As postet by Fionnuala: Editing the registry seems to solve the problem.

这篇关于SQL查询带有自定义文件扩展名的平面文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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