We help IT Professionals succeed at work.

MSaccess RELATIONSHIP view of an mdb created by vc++

Medium Priority
418 Views
Last Modified: 2013-11-25
Hello,

I have a VC++ program to create (from scratch !) a MDB with several tables as well as some 1:n relations between them. It works fine.
When I close the vc++ program and look at the mdb file (by opening MS Access, then click on RELATIONSHIP icon), then I get a graphical overview of the database. The bug is: some tables are displayed, others are NOT displayed. I want full control of which table to display and which not. Now it seems random. So :
1.) what is the command to tell to dao: "display table XY on pressing <Relationship> in MS Access" ?
2.) Can I also control the layout of the different tables (where are they positioned inside the relationship display) ?

I am NOT interested in any solutions inside  MS Access, I want the problem to be solved in my vc++ program, at the moment of the creation of the MDB.

Sonja

Comment
Watch Question

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
You have basically posted the same question again.  Please delete one or the other.

mx

Author

Commented:
theother is deleted.
Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
No, you cannot manipulate the relationships window, and it's somewhat buggy at best. Tables sometimes display and other times do not.

The diagram is simply a graphical representation of the relationships, but it has nothing to do with the actual relationships.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:

Author

Commented:
Hello LSMConsulting,

thanks a lot for your answer !
> Tables sometimes display and other times do not.
my impression is different: I have 32 tables, and my impression is: always the SAME 15 tables get displayed, after closing my vc++ program and opening ms access. It seems to not depend on whether I create the MDB from scratch or whether I change some records in the mdb, using my vc++ program.

> The diagram is simply a graphical representation of the relationships,
I understand, and this is perfect.

> but it has nothing to do with the actual relationships.
this I do not understand. Can you explain in other words ?

best regards, Sonja

The Relationship window is a graphical representation held for each ACCESS user, the default user being admin. This could be the reason you beleive that the views are random, you could be looking at it from different users.

There is NO automation of the graphical representation, however, you can program the relationships themselves. Try adding All Tables and save. When you close the Relationship window you should get an option to save it.

Cheers, Andrew
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
"Try adding All Tables and save. When you close the Relationship window you should get an option to save it."

TR ... see this same Q link http://www.experts-exchange.com/Programming/Languages/CPP/Q_23115129.html

I already mentioned that ...and she "is not interested in that solution"

mx

Author

Commented:
Hello Andrew,


> The Relationship window is a graphical representation held for each ACCESS user, the default user being admin.
interesting ! In my case, however, the PC is not in a network, and I am logged in as admin.

> This could be the reason you beleive that the views are random, you could be looking at it from different users.
it is random in the sense of: I do not see the logic behind how tables are selected to be shown. But it is constant / predictable in the sense of: there are always the same tables missing & the same tables displayed.

> There is NO automation of the graphical representation, however, you can program the relationships themselves.
yes, I have already done this, in vc++.

> Try adding All Tables and save. When you close the Relationship window you should get an option to save it.
this is a solution inside MS Access :-(


Thanks for your interesting thoughts. Sonja
MX this is http://www.experts-exchange.com/Programming/Languages/CPP/Q_23115129.html
perhaps you mean "VC++/DAO creates MDB, but MSAccess does not show all tables." http://www.experts-exchange.com/Microsoft/Development/.NET/Visual_CPP/Q_23114990.html.

Either way it is not possible to code and atleast a consistant message is being presented.

Cheers and best wishes, Andrew
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
"But it is constant / predictable in the sense of: there are always the same tables missing & the same tables displayed."

Note that *only* tables that have relationships established between them are going to show in the Relationship window.  I asked this question before:  Do you have relationships defined between ALL of the tables?  Or just between the 15 that are showing ?  Of course, form within Access, you and drag on or add a table to the diagram, whether or not it's in a relationship. But opening the window from VC++ (or doing the Show All from Access) is only going to show tables in a relationship.

mx
Hi sonja

"there are always the same tables missing & the same tables displayed." means that is was saved with these tables against your admin user in the MDB.

When you are creating the MDB from scratch is it a CreateDatabase command that you are executing or could it be copying an MDB as a template?

Cheers, Andrew

Author

Commented:
actually, mx has found the solution, but only thanks to the good answers of all other experts. My warmest thanks and best wishes go to  Andrew, TextReport and LSMConsulting. - Sonja
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
So, what was ... the solution ??  What did I find ?

mx

Explore More ContentExplore courses, solutions, and other research materials related to this topic.