By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,501 Members | 831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,501 IT Pros & Developers. It's quick & easy.

Any way to examine/manipulate relationships layout from code?

P: n/a
Hi all,

I was wondering if anyone has been able to find a way to read layout
information and manipulate the layout in the Relationships window. I've tried
a few different angles, but couldn't find anything.

Thanks,

- Steve J.
Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
I have a download at my site, but I forget exactly what it does. Have a look at ...
http://www.amazecreations.com/datafa...stRelation.zip
--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"Steve Jorgensen" wrote ...
Hi all,

I was wondering if anyone has been able to find a way to read layout
information and manipulate the layout in the Relationships window. I've tried
a few different angles, but couldn't find anything.

Nov 12 '05 #2

P: n/a
On Jan 15 2004, 04:07 pm, Steve Jorgensen <no****@nospam.nospam> wrote
in news:mc********************************@4ax.com:
I was wondering if anyone has been able to find a way to read layout
information and manipulate the layout in the Relationships window.
I've tried a few different angles, but couldn't find anything.


MichKa has a utility that transfers relationships layout between databases,
and I believe he mentioned once that it is stored as a single BLOB.
Obviously, it is possible to read that, but then you are on your own.

You can always do what the Print Relationships wizard does, and build your
own diagram in code.

--
(remove a 9 to reply by email)
Nov 12 '05 #3

P: n/a
What were you looking to do Steve?
I've played around with the windows that comprise the Relationship
window.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:mc********************************@4ax.com...
Hi all,

I was wondering if anyone has been able to find a way to read layout
information and manipulate the layout in the Relationships window. I've tried a few different angles, but couldn't find anything.

Thanks,

- Steve J.


Nov 12 '05 #4

P: n/a
On Fri, 16 Jan 2004 00:44:58 GMT, "Stephen Lebans"
<Fo****************************************@linval id.com> wrote:
What were you looking to do Steve?
I've played around with the windows that comprise the Relationship
window.


A couple of things. One thing, I could do with the tool Dimirti mentioned,
but I'm always hesitant to copy blobs around with internal meaning I don't
unserstand. For instance, what kind of corruption would be introduced if the
second database was missing a table that was in the original schema?

Basically, I want to back up the visual layout, so if I ever have to repair a
database by importing everything into a new database, I can get back the old
layout. A nice side benefit would be that one could save and restore
different layouts which would provide functionality similar to ADP database
diagrams.
Nov 12 '05 #5

P: n/a
I know decoding the BLOB is the proper way to accomplish what you want
to do but I can suggest an alternative method.
Each of the Table objects in the Relationship window is comprised of two
windows. THe parent window is of the class OEcl and it contains a child
ListBox control window.
I just tried and you can use GetWIndowText to retrieve the Caption of
each of the table object windows which corresponds to the table's name.
You can also get at each of the Fields/Expressions contained in the
child ListBox control. I have previously coded a solution to loop
through all of the windows in the Relationship WIndow in order to find
and repair any windows that have dropped off of the main window(happens
when you switch video card resolutions).
So you could easily save off the current dimesions and location of each
window to a file in order to restore the Relationship view at a later
time.
The code to play around with is in the Utilities MDB on my site in the
MISC section. THe code is minimal and was written for a NG poster whom
had lost a few windows off of the left edge of the Relationship window.

I'm not sure if this solves your issue or not Steve. I'd be glad to help
you put together a finished solution if you want.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:ng********************************@4ax.com...
On Fri, 16 Jan 2004 00:44:58 GMT, "Stephen Lebans"
<Fo****************************************@linval id.com> wrote:
What were you looking to do Steve?
I've played around with the windows that comprise the Relationship
window.
A couple of things. One thing, I could do with the tool Dimirti

mentioned, but I'm always hesitant to copy blobs around with internal meaning I don't unserstand. For instance, what kind of corruption would be introduced if the second database was missing a table that was in the original schema?

Basically, I want to back up the visual layout, so if I ever have to repair a database by importing everything into a new database, I can get back the old layout. A nice side benefit would be that one could save and restore
different layouts which would provide functionality similar to ADP database diagrams.


Nov 12 '05 #6

P: n/a
On Fri, 16 Jan 2004 03:25:34 GMT, "Stephen Lebans"
<Fo****************************************@linval id.com> wrote:
I know decoding the BLOB is the proper way to accomplish what you want
to do but I can suggest an alternative method.
Each of the Table objects in the Relationship window is comprised of two
windows. THe parent window is of the class OEcl and it contains a child
ListBox control window.
I just tried and you can use GetWIndowText to retrieve the Caption of
each of the table object windows which corresponds to the table's name.
You can also get at each of the Fields/Expressions contained in the
child ListBox control. I have previously coded a solution to loop
through all of the windows in the Relationship WIndow in order to find
and repair any windows that have dropped off of the main window(happens
when you switch video card resolutions).
So you could easily save off the current dimesions and location of each
window to a file in order to restore the Relationship view at a later
time.
The code to play around with is in the Utilities MDB on my site in the
MISC section. THe code is minimal and was written for a NG poster whom
had lost a few windows off of the left edge of the Relationship window.

I'm not sure if this solves your issue or not Steve. I'd be glad to help
you put together a finished solution if you want.


Actually, that sounds like it probably will handle my situation. If I know
what windows are there, and what their positions and sizes are, and if I have
a way to move/size the windows again later, then I just need to see if there's
something under DoCmd. to show and hide tables. If this works, I actually
think it would be more "proper" than decoding the blob.

I'll try it out, and see how far I get.
Nov 12 '05 #7

P: n/a
Steve I had a couple of hours to kill tonight so I put together a sample
MDB to Save or Restore the current layout fo the Relationship View
window. It requires a more functional GUI and better DAO interface and
error handling but it does work.

NEW - Jan 21/2004 A2KSave-RestoreRelationshipWindow.zip is an MDB
containing functions to Save and Restore the Relationships View Window.
Allows an unlimited number of different Relationship Window Views to be
saved.
http://www.lebans.com/saverelationshipview.htm
Here is the Access97 version:A97Save-RestoreRelationshipWindow.zip
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:0m********************************@4ax.com...
On Fri, 16 Jan 2004 03:25:34 GMT, "Stephen Lebans"
<Fo****************************************@linval id.com> wrote:
I know decoding the BLOB is the proper way to accomplish what you wantto do but I can suggest an alternative method.
Each of the Table objects in the Relationship window is comprised of twowindows. THe parent window is of the class OEcl and it contains a childListBox control window.
I just tried and you can use GetWIndowText to retrieve the Caption of
each of the table object windows which corresponds to the table's name.You can also get at each of the Fields/Expressions contained in the
child ListBox control. I have previously coded a solution to loop
through all of the windows in the Relationship WIndow in order to findand repair any windows that have dropped off of the main window(happenswhen you switch video card resolutions).
So you could easily save off the current dimesions and location of eachwindow to a file in order to restore the Relationship view at a later
time.
The code to play around with is in the Utilities MDB on my site in theMISC section. THe code is minimal and was written for a NG poster whomhad lost a few windows off of the left edge of the Relationship window.
I'm not sure if this solves your issue or not Steve. I'd be glad to helpyou put together a finished solution if you want.
Actually, that sounds like it probably will handle my situation. If I

know what windows are there, and what their positions and sizes are, and if I have a way to move/size the windows again later, then I just need to see if there's something under DoCmd. to show and hide tables. If this works, I actually think it would be more "proper" than decoding the blob.

I'll try it out, and see how far I get.


Nov 12 '05 #8

P: n/a
On Wed, 21 Jan 2004 05:28:34 GMT, "Stephen Lebans"
<Fo****************************************@linval id.com> wrote:
Steve I had a couple of hours to kill tonight so I put together a sample
MDB to Save or Restore the current layout fo the Relationship View
window. It requires a more functional GUI and better DAO interface and
error handling but it does work.

NEW - Jan 21/2004 A2KSave-RestoreRelationshipWindow.zip is an MDB
containing functions to Save and Restore the Relationships View Window.
Allows an unlimited number of different Relationship Window Views to be
saved.
http://www.lebans.com/saverelationshipview.htm
Here is the Access97 version:A97Save-RestoreRelationshipWindow.zip


Great - thanks.

I hadn't had time to try to assemble one myself out of what you already had,
and now I won't need to. Yet again, you have made Access a better product
than is was when Microsoft gave it to us (assuming your code works, and I
think I'm safe in assuming that).

Hopefully, I'll have time to try this out tomorrow.
Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.