Programatically delete relationships?

greaseman

Closer to seniority!
Local time
Today, 06:12
Joined
Jan 6, 2003
Messages
360
I know you can manually delete table relationships in an .mdb, but I was wondering: Can you programatically delete table relationships? If it is possible, how would it be done?

Thanks in advance to all you nice folk who reply.
 
Pat,

Thank you so very much!!! That was the code I was looking for!

Another question...... I have a project comprised of about 150 .mdb's. How would I, within a .mdb, cycle through those 150 .mdb's and in turn delete a certain relationship in each one? I only ask because I just don't want to have to place code into each one of the .mdb's to delete a relationship.

I think it would be more efficient if I was to be able to cycle through each database, deleting my desired relationship. Also, the relationships are no longer needed, so there is no prob there.... however I did set up a routine that goes through each .mdb, runninng queries, modules, etc... my only problem has been in using a Transfer command to put my modified tables back where they came. I get a message saying I can't do the transfer because the table in question is participating in a relationship.

Hope I explained myself satisfactorily and what I'm looking for.

Thank you again!!
 
Pat,

Thank you so very much. Sorry I didn't respond this last Friday. I appreciate your willingness to help others.
 
Pat,

How do you determine or find the names of relationships between tables? I looked in the Relationships menu and could not find anything.
 
Thank you, Pat..... it's truly appreciated.
 
Pat....one more time......

Can you do this type of thing to one .mdb from another .mdb?

I've got an .mdb with a module that cycles through the .mdb's in another folder, and everything is working with the exception of being able to delete my relationships.

What I want to do is to transfer one table from my big folder, run some queries against the table, then delete the relationships the table belongs to in my big folder, then transfer the updated table back to the big folder, and finally, recreate the relationships the table originally participated in.

Does that make sense, what I want to do?

Thanks for your input! With all the responses you've posted, how did you ever have toime to learn Access so well?
 
Hi, Pat....

I would love to run my "stuff" against the tables where they are, but am not sure how I would point my .mdb against the .mdb's in that other folder. I think that's where my headaches lie.

I was able to run my transfer database and then run my queries and modules against the table I pulled in, cycling through the table in each .mdb I wanted. However, due to the relatioships present in each .mdb in that other folder, was not able to do a transfer database command to put my modified table basck into its original .mdb - therein lies the problem I'm having.

If there's a way I can point my queries and modules to each of the .mdb's in that other folder, I'd be a happy programmer! Is there a way to do that?

And last but not least, so you've been programming for quite some time it seems. Sure is different nowadays than it was back then, I would guess.

Thanks for your replies and for your assistance!! Looking forward to it!
 
Pat,

Thanks for your reply..... I too remember those days of way back when. I was a computer operator on those old big mainframes, with tape drives, octal sorting algorithms, and also the fun of punch card decks (shades of Florida's "hangiong chads" !)

I'll try linking to my desired tables and doing what I need to do..... thanks for the hints.

Take care, and have a great Monday.:)
 
Hi again, Pat....

Guess what..... I did not explain myself as fully as I thought .... my mistake (apologies!!). The linking worked, however, I also need to add two fields to my talbe in question, and linking does not allow that. How might I go about doing the removal of relationships, run my queries, add a couple of fields to my desired table and thenre-establish my relationships??

I feel really like "Duhhh!" for not mentioning about my need to add fields to the table. :o

Thaks again for your input and assistance.... it's great learning as much as I have from this forum.
 
Pat,

Please disregard my last posting.... I figured out what I had to do.

Thanks so much for your help on this issue. You saved me a lot of time and aspirin.:cool:
 

Users who are viewing this thread

Back
Top Bottom