Using a UNION statement with MSAccess

Posts   
 
    
Aglaia avatar
Aglaia
LLBLGen Pro Team
Posts: 535
Joined: 07-Sep-2003
# Posted on: 21-Aug-2007 14:13:38   

Question: I have an MS Access stored query which returns a SELECT using a UNION statement. It doesn't show up in my LLBLGen Pro project, is this an error/bug?

Solution: The MS Access driver uses, among other things, OleDbConnection.GetOleDbSchemaTable() for retrieving the schema information. It turns out, if you use a UNION in your stored query, it doesn't show up in the list of views in the MS Access database. To work around this, create a new stored query which simply returns all the rows of the stored query that isn't seen by LLBLGen Pro and use that one instead.