[AccessD] Programmatically creating relationships

Michael R Mattys mmattys at rochester.rr.com
Wed Mar 28 09:08:59 CDT 2007


Hi John,

I have a lot of code mixed with what I pulled out of one of the viewable
add-ins for Access 97 that uses calls to msaccess.exe. If you think
that might be of help, I could dig it up.

Michael R. Mattys
MapPoint & Access Dev
www.mattysconsulting.com

----- Original Message ----- 
From: "JWColby" <jwcolby at colbyconsulting.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Tuesday, March 27, 2007 1:44 PM
Subject: Re: [AccessD] Programmatically creating relationships


> Bobby,
>
> I normally have relationships established between parent / child.   Very
> occasionally I will be building a child table live in the BE and can't get
> the lock to the parent to get the relationship and it slips through the
> cracks.  I have also had to split the BE to put some large or problematic
> tables out in their own container etc.  All of these need to be pulled in 
> to
> a common container, all those parent / child relationships established
> BEFORE the migration to SQL Server so that the migration wizard can
> correctly set up the relationships in SQL Server.
>
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bobby Heid
> Sent: Tuesday, March 27, 2007 2:02 PM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Programmatically creating relationships
>
> John,
>
> I do not have an answer for you.  But have you looked at doing it in SQL
> Server Manager and then having it copy the script to the clipboard or a
> file?  I recently took a class in SQL Server 2005 and the instructor 
> showed
> us how to something and then before closing it/saving it, showed us how to
> save the script to create the object(s) that we just created in the GUI.
>
> Bobby
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of JWColby
> Sent: Tuesday, March 27, 2007 1:39 PM
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Programmatically creating relationships
>
> I am starting the process of migrating a large database from Access to SQL
> Server.  One of the things I have to do is go find all the places where
> relationships were missed / couldn't be established for some reason and 
> get
> them in there.  I am doing this offline first and being the meticulous guy 
> I
> am, I want to be able to build up a program that does much of this stuff 
> so
> that as I document what has to be done, I also have code that will do it 
> the
> next time.
>
> For example, I have written a function that finds orphaned records in a
> child table and deletes them out.  What I need to do next is establish a
> relationship between the parent / child.  I can write that code but have
> never done so and would use borrowed code if anyone out there has a lib of
> such relationship oriented functions.  Given a parent table / PK and a 
> child
> table / FK, establish a relationship.
>
> Does anyone have that?
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com 




More information about the AccessD mailing list