Good day,
I'm using the OleDbDataAdapter in VB.NET to load query results into a data set.
However, when I step through the code it only loads the columns into the data set and not the rows in the query.
I did do a brief test by exporting that query result into a separate Access DB and then tried loading it and it worked correctly.
I am unsure whether or not the command for Fill supports loading of query results?
This is the code I am using to load up the Access table:
Dim dsAccess As New DataSet
Dim da As OleDb.OleDbDataAdapter
Try
If conAccess.State = ConnectionState.Open Then
sql = "SELECT * FROM " & strTblName
da = New OleDb.OleDbDataAdapter(sql, conAccess)
da.Fill(dsAccess, strTblName)
Else
Return False
End If
Catch ex As System.Exception
Return False
Finally
da = Nothing
End Try
Note, I've edited this question to show the actual table structure of my "query".
That's the query I'm trying to perform the Select on.
The design view of the query:
Hopefully this helps in diagnosing this issue!