CesarGon
asked on
Creating views with ADOX
Hi all,
I'm trying to create a query on a Jet 4 database using ADOX. My code is as follows:
Dim ca As New Catalog
ca.Create "Provider=Microsoft.Jet.OL EDB.4.0;Da ta source=C:\Temp\Test.mdb"
Dim co As New Command
co.CommandType = adCmdText
co.CommandText = "SELECT * FROM TableName"
ca.Views.Append "TestView", co
That runs without errors, and I can see the query just created in the MSysObjects and MSysQueries system tables. I can even execute it from code. But it does not appear on the Access database window. The properties in the system tables are different from the properties of queries created using Access.
What should I do to view the query in the Access database window?
Regards,
Cesar.
I'm trying to create a query on a Jet 4 database using ADOX. My code is as follows:
Dim ca As New Catalog
ca.Create "Provider=Microsoft.Jet.OL
Dim co As New Command
co.CommandType = adCmdText
co.CommandText = "SELECT * FROM TableName"
ca.Views.Append "TestView", co
That runs without errors, and I can see the query just created in the MSysObjects and MSysQueries system tables. I can even execute it from code. But it does not appear on the Access database window. The properties in the system tables are different from the properties of queries created using Access.
What should I do to view the query in the Access database window?
Regards,
Cesar.
Access doesn't have real views. It has Queries. Try to add them as Stored Procs.
Please maintain these open questions:
Accessing MAPI profile from stored procedure Date: 08/01/2001 08:35AM PST
https://www.experts-exchange.com/questions/20161619/Accessing-MAPI-profile-from-stored-procedure.html
USR Sportster on W2K Date: 12/07/2000 03:33AM PST
https://www.experts-exchange.com/questions/20000922/USR-Sportster-on-W2K.html
Access to a PPTP server beyond firewall Date: 10/19/2001 08:55AM PST
https://www.experts-exchange.com/questions/20195669/Access-to-a-PPTP-server-beyond-firewall.html
Thanks,
Anthony
Accessing MAPI profile from stored procedure Date: 08/01/2001 08:35AM PST
https://www.experts-exchange.com/questions/20161619/Accessing-MAPI-profile-from-stored-procedure.html
USR Sportster on W2K Date: 12/07/2000 03:33AM PST
https://www.experts-exchange.com/questions/20000922/USR-Sportster-on-W2K.html
Access to a PPTP server beyond firewall Date: 10/19/2001 08:55AM PST
https://www.experts-exchange.com/questions/20195669/Access-to-a-PPTP-server-beyond-firewall.html
Thanks,
Anthony
ASKER
emoreau, thanks for your reply. I have tried to add them as Catalog.Views and Catalog.Procedures, but the result is always what I have described.
ASKER
Anthony, what should I do with those questions?
The one about MAPI has not been answered, and nobody has proposed any helpful comment. The one about the modem makes no sense anymore, since I'm not using that modem anymore, and problem suddenly fixed itself. The one about PPTP has a proposed answer with no text. What should I do?
I have repeatedly proposed to Community Support that they put in place some mechanism to delete or PAQ questions when they are no longer applicable or no experts seem to have an answer. I did not have any success by the moment.
So, what can you recommend?
Thanks & regards,
Cesar.
The one about MAPI has not been answered, and nobody has proposed any helpful comment. The one about the modem makes no sense anymore, since I'm not using that modem anymore, and problem suddenly fixed itself. The one about PPTP has a proposed answer with no text. What should I do?
I have repeatedly proposed to Community Support that they put in place some mechanism to delete or PAQ questions when they are no longer applicable or no experts seem to have an answer. I did not have any success by the moment.
So, what can you recommend?
Thanks & regards,
Cesar.
I would post a message in Community Support asking to delete these questions.
Anthony
Anthony
ASKER
Anthony, thank for the suggestion. I will do.
If it is any consolation I duplicated your problem with creating the query using ADOX. According to MSDN the only way you can create a query in Access is using DAO (ugh!)
Anthony
Anthony
ASKER
Anthony, thanks again. My problem is not creating queries; actually I can create them with ADOX and use them later from code. My problem is viewing such queries in the Access database window!
ADOX seems to be able to create the queries, but apparently it does not set all necessary properties so Access realises that the queries exist.
Regards,
Cesar.
ADOX seems to be able to create the queries, but apparently it does not set all necessary properties so Access realises that the queries exist.
Regards,
Cesar.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Anthony.
Maybe they add that functionality to ADO.NET sometime!
Maybe they add that functionality to ADO.NET sometime!