Hello:
We just upgraded to SolidWorks and PDM 2021. I have some programs that utilizes accessing some spreadsheets to obtain data. Those programs use the Microsoft ActiveX Data Objects 6.1 Library. As I understand it, there are two versions of this file, one for 32-bit and one for 64-bit.
32-bit: c:\Program Files(x86)\Common Files\ado\msado15.dll
64 bit: c:\Program Files\Common Files\ado\msado15.dll
The new Version of SolidWorks and PDM no longer support 32-bit applications, so my code is setup to only run in 64-bit mode.
Below is my code:
I have manually registered both dll files, but am still getting the error:Code:Dim cn As String = "Provider = Microsoft.OLEDB.12.0; Data Source = " & "\\w2012\users\QUOTES\Templates\pricing report-2.xls" & "; Extended Properties = " & Chr(34) & "Excel 12.0; HDR = Yes; IMEX = 1" & Chr(34) & "; "
Dim sql As String = "SELECT [Part ID], [Description], [Inv. UoM], [Last Unit Cost], [Avg. Unit Cost] FROM [Sheet1$]"
Dim connExcel As New System.Data.OleDb.OleDbConnection(cn)
Dim cmdExcel As New System.Data.OleDb.OleDbCommand()
Dim oda As New System.Data.OleDb.OleDbDataAdapter()
cmdExcel.Connection = connExcel
connExcel.Open()
Dim dtExcelSchema As Data.DataTable = connExcel.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, Nothing)
connExcel.Close()
The 'Microsoft.OLEDB.12.0' provider is not registered on the local machine.
The error occurs on this line of code:
I registered the dll as follows:Code:connExcel.Open()
, and a box came up saying DllRegisterServer in C:\Program Files\Common Files\system\msado15.dll succeeded.Code:regsvr32 "C:\Program Files\Common Files\system\ado\msado15.dll"
I am not sure where to go from here. If I change my settings to support 32-bit, the SolidWorks and PDM portions of the program will not work. Basically, I cannot have this both ways.
Thanks in advance!