Unanswered: Error : Unions not allowed in subquery
I am using ADO to create views in MS Access database. I created two views called STickets and ETickets from some tables. These two views have the same fields. Now I am trying to create another View called Summary which is a Union on the above two views. My code reads as follows :
Dim cn As adodb.Connection
Dim cmd As adodb.Command
Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
cat.ActiveConnection = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\Test\TICKETS.MDB;Jet OLEDBatabase Password=test"
Set cmd = New adodb.Command
cmd.CommandText = "Select * FROM STickets UNION Select * FROM ETickets"
cat.Views.Append "Summary", cmd