直接访问vfp dbf文件时报错:
错误描述: 'd:\vfpData\test.dbf'不是一个有效的路径。 确定路径名称拼写是否正确,以及是否连接到文件存放的服务器。
解决办法:Data Source=目录!!!!!!(d:\vfpData)
(1)------------------------------------------------------------------------------------------------
-
-
Standard (DBF / FoxPro)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;
Extended Properties=dBASE IV;User ID=Admin;Password=; 参考:http://www.connectionstrings.com/dbf-foxpro/
- 更多连接字符串参考:http://www.connectionstrings.com
-
(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"
========================================================