Resolved List all Access queries in a ComboBox

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
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:
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()
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?
 
Back
Top