I currently have a project where I'm to provide different views of the data from the tables and since it's an Access database I figured why not just make queries then list them in the ComboBox:
Then just loop the dtSchema table and viola, everything works and has been for quite a while now, but I was asked to make a few views in which the easiest way to do that is to make a query that uses the sql UNION statement and now that code above lists all of the Tables & Queries except my 3 UNION queries. I've been doing some googling and I'm not finding anything to why those queries aren't in my schema table, anyone have any ideas?
VB.NET:
Dim cnSchema As OleDbConnection = GetConnection(Me.ddlDatabase.SelectedValue)
cnSchema.Open()
Dim dtSchema As DataTable = cnSchema.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "VIEW"})
cnSchema.Close()