SummerRain

软件开发/信息安全
随笔 - 246, 文章 - 0, 评论 - 240, 阅读 - 36万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

直接访问vfp dbf文件时报错:

错误描述: 'd:\vfpData\test.dbf'不是一个有效的路径。 确定路径名称拼写是否正确,以及是否连接到文件存放的服务器。

解决办法:Data Source=目录!!!!!!(d:\vfpData)

(1)------------------------------------------------------------------------------------------------

Microsoft Jet OLE DB 4.0

(2)------------------------------------------------------------------------------------------------
Hi Abhay,

I recommend that you use the OLE DB data provider for FoxPro and Visual
FoxPro.

There are two formats that the connection string should take, depending on
what data you have.

For FoxPro "free" tables use just the path to the directory where the DBFs
are: "Provider=VFPOLEDB.1;Data Source=C:\Temp;"
 Note that the Data Source is
not in quotes it's delimited bye the equal sign and the semicolon. When you
want to work with a specific table you'll specify it in your SQL string:
strSQL = "Select * From SomeTable" (Table is C:\Temp\SomeTable.dbf)

For Visual FoxPro tables that belong to a "Database Container" you need to
specify the DBC in the connection string: "Provider=VFPOLEDB.1;Data
Source=C:\Temp\MyDBC.dbc;" If a DBC file is present with the DBFs then use
this format, otherwise use the free table format. Again refer to a specific
table in your SQL command: strSQL = "Select * From SomeTable"

 

========================================================

 

 

 

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示