- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
I am trying to query a SQL database from iLogic with Inventor 2016. I have written some code in VB.net which seems to work. I can create the connection and query a table. But copy and paste of this code doesn't work directly in iLogic.
Does any one have any recent experience? I found a couple links on the forum mentioning to add reference to Microsoft ActiveX Data Objects 2.8 Library, but I am not sure how this reference can be added in ilogic. Here is the link i am reffering to.Link to post
Here is what I have so far and the result error and warning. Any advice would be appreciated.
Dim Connection As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=SQLNCLI11;Data Source=#####;Persist Security Info=True;User ID=###;PWD=###;Initial Catalog=###") Dim Command As New OleDb.OleDbCommand Dim ds As New DataSet Dim da As New OleDb.OleDbDataAdapter 'Dim rowo As System.Data.DataRow 'Dim Count As Integer Connection.Open() 'open up a connection to the database Command.Connection = Connection Dim partnum As String = "xxx-xxxxxxxx" Dim query As String = "Select SpringSAPPN FROM Springs WHERE SpringGSPN ='" + partnum + "' " da.SelectCommand = New OleDb.OleDbCommand(query, Connection) da.Fill(ds, "Table") 'Fill the dataset, ds, with the above SELECT statement 'Count = ds.Tables("Table").Rows.Count MessageBox.Show(ds.Tables(0).Rows(0)(0).ToString)
Solved! Go to Solution.
Link copied