我尝试使用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 –