Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating views with ADOX

Posted on 2002-07-23
10
Medium Priority
?
272 Views
Last Modified: 2013-12-25
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.OLEDB.4.0;Data 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.
0
Comment
Question by:CesarGon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7174086
Access doesn't have real views. It has Queries. Try to add them as Stored Procs.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7175965
Please maintain these open questions:
Accessing MAPI profile from stored procedure Date: 08/01/2001 08:35AM PST
http://www.experts-exchange.com/mssql/Q_20161619.html
USR Sportster on W2K Date: 12/07/2000 03:33AM PST
http://www.experts-exchange.com/modems/Q_20000922.html
Access to a PPTP server beyond firewall Date: 10/19/2001 08:55AM PST
http://www.experts-exchange.com/winntnet/Q_20195669.html

Thanks,
Anthony





0
 
LVL 3

Author Comment

by:CesarGon
ID: 7176060
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:CesarGon
ID: 7176069
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.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7176182
I would post a message in Community Support asking to delete these questions.

Anthony
0
 
LVL 3

Author Comment

by:CesarGon
ID: 7176206
Anthony, thank for the suggestion. I will do.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7176229
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
0
 
LVL 3

Author Comment

by:CesarGon
ID: 7176237
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.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 800 total points
ID: 7177703
What I meant was the only way you can create Access queries that you can see in the database is with DAO.  Check out this article from MSDN:
Using ActiveX Data Objects in Microsoft Access 2000
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/acmscUsingADOInAccess2000.asp

and I think you will see what I mean.

Anthony
0
 
LVL 3

Author Comment

by:CesarGon
ID: 7178677
Thanks, Anthony.

Maybe they add that functionality to ADO.NET sometime!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question