我嘗試使用C#連接到DBF數據庫(我嘗試3種連接的)如何連接到DBF數據庫
string connectionString = @"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\employees.dbf;";
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\employees.dbf;Extended Properties=dBASE IV;";
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\employees.dbf;Extended Properties=dBASE IV;User ID=Admin;Password=;";
using (OdbcConnection connection = new OdbcConnection(connectionString))
{
connection.Open();
}
,我得到了錯誤
ERROR1:
ERROR [HY024] [Microsoft][ODBC dBase Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
ERROR [HY024] [Microsoft][ODBC dBase Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
或錯誤2:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
what c一個是問題?
在此先感謝
得到此錯誤:錯誤[IM002] [微軟] [ODBC驅動程序管理器]數據源找不到名稱並且沒有指定默認驅動程序 – Gali
如果您使用的是64位服務器,則需要使用「Provider = Microsoft.Jet.OLEDB.12.0」。我知道這是一個古老的線程,但只是有人偶然發現這個..... –
謝謝Crisim II Numenoreano –