Foxpro數據庫連接錯誤解決方法--【VFP DBF文件不是一個有效的路徑。 確定路徑名稱拼寫是否正確,以及是否連接到文件存放的服務器】


直接訪問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"

 

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

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM