Connecting Tech Pros Worldwide Help | Site Map

Any way to examine/manipulate relationships layout from code?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:09 PM
Steve Jorgensen
Guest
 
Posts: n/a
Default Any way to examine/manipulate relationships layout from code?

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.

  #2  
Old November 12th, 2005, 06:09 PM
Danny J. Lesandrini
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

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
dlesandrini@hotmail.com
http://amazecreations.com/datafast


"Steve Jorgensen" wrote ...[color=blue]
> 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.
>[/color]


  #3  
Old November 12th, 2005, 06:10 PM
Dimitri Furman
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

On Jan 15 2004, 04:07 pm, Steve Jorgensen <nospam@nospam.nospam> wrote
in news:mc0e00pviio7t6vn56tl9ku1mo41qbeki8@4ax.com:
[color=blue]
> 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.[/color]

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)
  #4  
Old November 12th, 2005, 06:10 PM
Stephen Lebans
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

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" <nospam@nospam.nospam> wrote in message
news:mc0e00pviio7t6vn56tl9ku1mo41qbeki8@4ax.com...[color=blue]
> 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.[/color]
I've tried[color=blue]
> a few different angles, but couldn't find anything.
>
> Thanks,
>
> - Steve J.[/color]

  #5  
Old November 12th, 2005, 06:10 PM
Steve Jorgensen
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

On Fri, 16 Jan 2004 00:44:58 GMT, "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote:
[color=blue]
>What were you looking to do Steve?
>I've played around with the windows that comprise the Relationship
>window.[/color]

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.
  #6  
Old November 12th, 2005, 06:10 PM
Stephen Lebans
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

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" <nospam@nospam.nospam> wrote in message
news:ngfe00hkvbgotimbqfuhurt2d6i26calgr@4ax.com...[color=blue]
> On Fri, 16 Jan 2004 00:44:58 GMT, "Stephen Lebans"
> <ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote:
>[color=green]
> >What were you looking to do Steve?
> >I've played around with the windows that comprise the Relationship
> >window.[/color]
>
> A couple of things. One thing, I could do with the tool Dimirti[/color]
mentioned,[color=blue]
> but I'm always hesitant to copy blobs around with internal meaning I[/color]
don't[color=blue]
> unserstand. For instance, what kind of corruption would be introduced[/color]
if the[color=blue]
> 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[/color]
repair a[color=blue]
> database by importing everything into a new database, I can get back[/color]
the old[color=blue]
> layout. A nice side benefit would be that one could save and restore
> different layouts which would provide functionality similar to ADP[/color]
database[color=blue]
> diagrams.[/color]

  #7  
Old November 12th, 2005, 06:10 PM
Steve Jorgensen
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

On Fri, 16 Jan 2004 03:25:34 GMT, "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote:
[color=blue]
>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.[/color]

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.
  #8  
Old November 12th, 2005, 06:18 PM
Stephen Lebans
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

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" <nospam@nospam.nospam> wrote in message
news:0mne00ds5uc0goobdmt00e739mrvlf6335@4ax.com...[color=blue]
> On Fri, 16 Jan 2004 03:25:34 GMT, "Stephen Lebans"
> <ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote:
>[color=green]
> >I know decoding the BLOB is the proper way to accomplish what you[/color][/color]
want[color=blue][color=green]
> >to do but I can suggest an alternative method.
> >Each of the Table objects in the Relationship window is comprised of[/color][/color]
two[color=blue][color=green]
> >windows. THe parent window is of the class OEcl and it contains a[/color][/color]
child[color=blue][color=green]
> >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[/color][/color]
name.[color=blue][color=green]
> >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[/color][/color]
find[color=blue][color=green]
> >and repair any windows that have dropped off of the main[/color][/color]
window(happens[color=blue][color=green]
> >when you switch video card resolutions).
> >So you could easily save off the current dimesions and location of[/color][/color]
each[color=blue][color=green]
> >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[/color][/color]
the[color=blue][color=green]
> >MISC section. THe code is minimal and was written for a NG poster[/color][/color]
whom[color=blue][color=green]
> >had lost a few windows off of the left edge of the Relationship[/color][/color]
window.[color=blue][color=green]
> >
> >I'm not sure if this solves your issue or not Steve. I'd be glad to[/color][/color]
help[color=blue][color=green]
> >you put together a finished solution if you want.[/color]
>
> Actually, that sounds like it probably will handle my situation. If I[/color]
know[color=blue]
> what windows are there, and what their positions and sizes are, and if[/color]
I have[color=blue]
> a way to move/size the windows again later, then I just need to see if[/color]
there's[color=blue]
> something under DoCmd. to show and hide tables. If this works, I[/color]
actually[color=blue]
> think it would be more "proper" than decoding the blob.
>
> I'll try it out, and see how far I get.[/color]

  #9  
Old November 12th, 2005, 06:18 PM
Steve Jorgensen
Guest
 
Posts: n/a
Default Re: Any way to examine/manipulate relationships layout from code?

On Wed, 21 Jan 2004 05:28:34 GMT, "Stephen Lebans"
<ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote:
[color=blue]
>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[/color]

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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.