If you want to connect Microsoft Access Database through Inventor iLogic, a data connectivity driver called “2007 Office System Driver : Data Connectivity Components” is required to install in system. It can be downloaded from this link.
After successful installation of driver,the following iLogic code can be used to access Microsoft Access database in Inventor 2017
AddReference "System.Data" AddReference "System.Core" AddReference "System.Xml" Imports System.Data.OleDb Imports System.Data Imports System.Xml Sub Main() Dim Table_ As String = "EmployeeInfo" Dim query As String = "SELECT * FROM " & Table_ Dim MDBConnString_ As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Temp\EmployeeInfo.accdb;Persist Security Info=False;" Dim ds As New DataSet Dim cnn As OleDbConnection = New OleDbConnection(MDBConnString_) cnn.Open() Dim cmd As New OleDbCommand(query, cnn) Dim da As New OleDbDataAdapter(cmd) da.Fill(ds, Table_) cnn.Close() Dim t1 As DataTable = ds.Tables(Table_) Dim row As DataRow Dim Item(2) As String For Each row In t1.Rows MessageBox.Show("EID : " & row(0) & " and Employee Name : " & row(1) Next End Sub
To demonstrate code, a sample database (EmployeeInfo.accdb) is created and that would like as shown below.
Sample database can be downloaded from here. After downloading database to desire location, path of database should be updated in the above iLogic code.