Tag: oledb

Microsoft.Jet.OLEDB.4.0“提供程序未在本地计算机上注册

我在32位Windows 2008服务器中创build了一个在.NET 3.5中开发的Windows应用程序。 在64位服务器上部署应用程序时,显示错误“Microsoft.Jet.OLEDB.4.0”提供程序未在本地计算机上注册“。 所以作为这个问题的一个解决scheme,我已经把项目的build属性改成了X86,这样它就可以build立32位模式,并在32位机器上重build项目。 但是,同一个项目使用其他数据库驱动程序(DB2,SQL等)连接到其他数据库。 因此,当我在64位操作系统中再次部署我的应用程序时,它会抛出exception“试图在32位平台上加载64位程序集”。 我正在使用Microsoft.Jet.OLEDB.4.0驱动程序读取和写入Excel(.xls)

Microsoft.ACE.OLEDB.12.0提供程序未注册

我有一个Visual Studio 2008解决scheme与两个项目(Word模板项目和VB.Net控制台应用程序进行testing)。 两个项目都引用了一个数据库项目,该项目打开一个到MS-Access 2007数据库文件的连接,并具有对System.Data.OleDb的引用。 在数据库项目中,我有一个函数,如下所示检索数据表 private class AdminDatabase ' stores the connection string which is set in the New() method dim strAdminConnection as string public sub New() … adminName = dlgopen.FileName conAdminDB = New OleDbConnection conAdminDB.ConnectionString = "Data Source='" + adminName + "';" + _ "Provider=Microsoft.ACE.OLEDB.12.0" ' store the connection string in strAdminConnection strAdminConnection […]

OleDB和混合Excel数据types:缺less数据

我有一个Excel工作表,我想读入一个数据表 – 除了Excel工作表中的一个特定列以外,一切都很好。 “ProductID”这一列是像##########和n#########这样的值的混合。 我试图让OleDB自动处理所有东西,通过读取到数据集/数据表中,但是像' n###### '这样的'ProductID'中的任何值都丢失,忽略并留空。 我尝试通过使用datareader循环每一行手动创build我的DataTable,但具有完全相同的结果。 代码如下: // add the column names manually to the datatable as column_1, column_2, … for (colnum = 0; colnum < num_columns; colnum ++){ ds.Tables["products"].Columns.Add("column_" +colnum , System.Type.GetType("System.String")); } while(myDataReader.Read()){ // loop through each excel row adding a new respective datarow to my datatable DataRow a_row = ds.Tables["products"].NewRow(); […]