Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Exclamation Unanswered: Automate Forming a Relationship?

    How can I view the code that forms a relationship so that I can use it for automating the relationship join?
    Thanks,
    CaRa
    CaRa

  2. #2
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Angry still need some help

    Anybody? Can this be done?
    CaRa

  3. #3
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    not sure what you are trying to do. once a relationship is saved its there forever, why are you automating it?
    Jim

  4. #4
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Post

    I'm trying to aytomate the formation of the relationship - I start with an automated import of data and then I need to form a relationship between that imported table and my own so I can run automated queries - then relationship and imported table are all deleted once I take query info to update my own table - this will reoccur everytime the database is accessed, and should require no human interaction, so since I need the relationship, and I have to reestablish it each time i import i guess I'm looking for a way to automate it to be done, so that I don't have to stop the process each time.
    CaRa

  5. #5
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by caraev11
    I'm trying to aytomate the formation of the relationship - I start with an automated import of data and then I need to form a relationship between that imported table and my own so I can run automated queries - then relationship and imported table are all deleted once I take query info to update my own table - this will reoccur everytime the database is accessed, and should require no human interaction, so since I need the relationship, and I have to reestablish it each time i import i guess I'm looking for a way to automate it to be done, so that I don't have to stop the process each time.

    are the files the same every time? if they are you can import them into a stage table that has the relationship already built, then run a delete step on the stage table to clear the data in it, not delete the table.
    does that make sence to you?
    Jim

  6. #6
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22
    The files are always the same (same name of table I'm importing, same name I then save it to, same name of table I use for updates) but what is a stage table? That sounds good - I import the data into that thing, which already has the relationship to my own table, and then that lets me bypass the forming of the relationship, and when I'm done, I delete cells, or the table?
    thank you
    CaRa

  7. #7
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Arrow One thing...

    ONE QU: does running a delete step mean a delete query of sorts? will deleting from a table in a relationship affect the table it has the relationship to? i don't want to delete data from the table I update to
    CaRa

  8. #8
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Re: One thing...

    Originally posted by caraev11
    ONE QU: does running a delete step mean a delete query of sorts? will deleting from a table in a relationship affect the table it has the relationship to? i don't want to delete data from the table I update to
    first off a stage table is just a temp table structuer ie column names column data types column lengths and relationships, sorta like a shell. you create it according to your text files. In your proccess you just import into the stage table abosed to importing into a new table, and yes the delete step that I spoke of is just a delete query.

    the type of relationship that you set up will dictate what happens when a table is deleted. Make sure cascade delete is turned off to prevent deletions from the updated table.

    Test it out a bit see if you can get it to work
    Jim

  9. #9
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Re: One thing...

    Test it out a bit see if you can get it to work
    Jim [/SIZE][/QUOTE]

    Yes, I'm going to go try that out right now, to see if that works - thanks for the responses, I appreciate it :O)
    CaRa

  10. #10
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Angry Re: One thing...

    It saves the import table as "Shell Import Table 1", when I direct it to save as "Shell Import Table". I had previously made a shell of a table and named it that and tried to import the data there, but it wants to put it in it's own table...also, the relationship wouldn't enforce referential integrity b/c I had no data in the shell table - I need the enforce b/c I need cascade updates...maybe if I play around with it a bit I'll stumble upon a way to make the shell table thing work...is that the ony way to non-manually have to make the relationship, you think? Sometimes I don't like Access too much, and this past 2 weeks has been one of those times :O)
    Thanks so much for all of your help, though.
    CaRa

  11. #11
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    have you concidered linking to the data instead of importing?
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  12. #12
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    hope that i could get you on the right path, i dont know any other way to create a relationship though. Sorry
    Jim

  13. #13
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22
    I have, and my mission is a a bit our of the way, but it's not mine to choose. If I link, then when I change any data, it affects the data in the other db that has the table i'm taking data from - she has very little know-how in Access, and so I have to function what I need to do without being invasive to her database - my ultimate objective to to import and look at her data and then update her added records and editted records to my table - all automated, at the start of the program run. This is much more complex a task than I thought it would be, and I know no VBA, so I'm stuck looking at macros and queries to try and pull it off. I'm kinda at a loss- I've been reading Access help for about two weeks, and I took 2 Access classes, but nothing has really given insight into my particular task - there must be some way of comparative updating? Maybe I don't need the relationship - can I code the formation of the relationship, perhaps?
    CaRa

  14. #14
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    THANK YOU :O)

    you have been much help, at least I know one more way that I can't do it :O) - again, thanks for your time
    CaRa

  15. #15
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    if thats the case there is one other route(it's a right pain in the ar*e to do) and i can only offer limited help as i only know the theory and have never accualy tried

    it first you import the data into a temp table
    then screen that table into two other changes to excisting record and new records
    then you update the changes table into the destination table
    then you append the new record
    finally you delete all the temp tables
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •