打开 dBase 表
我必须使用 ADOConnection 和 AdoTable 从旧 dBase 数据库复制一些信息。我可以打开所有表,但出现此异常
数据提供商或其他服务 返回 E_FAIL 状态
尝试打开 1.01 GB(1 093 588 624 字节)的大表时 。我注意到性能非常糟糕。这是连接字符串
ConnectionString:=Format('Provider=Microsoft.JET.OLEDB.4.0;Data Source=%s;Extended Properties=dBase IV;',[path])
I have to copy some information from an old dBase database using ADOConnection and AdoTable. I am able to open all tables but I get this exception
Data provider or other service
returned an E_FAIL status
while trying to open a big table 1.01 GB (1 093 588 624 bytes). I note that the performance is very bad. this is the connection string
ConnectionString:=Format('Provider=Microsoft.JET.OLEDB.4.0;Data Source=%s;Extended Properties=dBase IV;',[path])
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我相信 TADOConnection 的
CursorLocation
的默认设置是clUseClient
。通过该设置,整个数据集将由客户端读入内存。这可以解释缓慢的情况并可能解释错误。尝试将其更改为
clUseServer
。或者您可以在对象检查器属性中更改它。
I believe that the default setting for
CursorLocation
with TADOConnection isclUseClient
. With that setting, the entire data set is read into memory by the client. That would explain the slowness and may explain the error.Try changing it to
clUseServer
.Or you can change it in the object inspector properties.
这听起来像是标头中有一个自动打开(.MDX)索引标志,但数据库中不存在该索引。
您可以尝试此操作 - 它会清除数据库标头中的自动打开标志。 使用数据库的副本进行测试!!! 我尚未在 DBase IV 上进行测试,但它适用于 FoxPro 和 DBase 的多种版本。
清除标头中的该标志后,您应该能够使用 ADO 或 Advantage Database Server(其本地服务器)打开 .DBF免费,并且支持 SQL。请注意,我与 Advantage 没有任何关系;我已经使用他们的产品处理旧版 DBF 文件很长时间了。
This sounds like it's got an autoopen (.MDX) index flag in the header, but the index doesn't exist in the database.
You can try this - it clears that autoopen flag in the database header. USE A COPY OF THE DATABASE TO TEST ON!!! I haven't tested on DBase IV, but it works on several flavors of FoxPro and DBase.
After clearing that flag in the header, you should be able to open the .DBF with ADO or Advantage Database Server - their local server is free, and supports SQL. Note that I'm not affiliated with Advantage in any way; I've just used their product to work with legacy DBF files for a long time.
如果您仍然遇到 TAdoConnection 问题,我建议您使用 Apollo。这支持许多不同的表类型(Clipper NTX、Foxpro CDX)。
If you still have problems with TAdoConnection I would suggest Apollo. This supports many different table types (Clipper NTX, Foxpro CDX).