Results 1 to 2 of 2

Thread: COM Objects within COM Objects

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Chicago, IL
    Posts
    1
    OK...Here goes...
    I have a series of COM objects that represent a data structure. I'll use a CAR object as an example...

    The CAR object has references to numerous other objects...the ENGINE object, the TRANSMISSION object, etc...each containing the properties of that object. From the EXE, I can set each of these object's properties as follows...
    car.engine.size = "5.0"
    car.engine.miles = 23000
    The problem come up when I have a many to 1 relationship, such as the TIRES object. Each instance of the CAR object has multiple instances of the TIRES object. I can't figure out how to get data into the TIRES object's properties. I have tried using both an ARRAY of TIRES objects and a COLLECTION of TIRES objects within the CARS object, but I can't seem to get data into the TIRES object from the EXE without passing in a seperate instance of the TIRES object from the EXE into the CAR object...

    I have probably confused everyone more than I have explained my situation, but if ANYONE has ANY insight into this problem, PLEASE let me know...

    Thanks in advance,
    John Schuetz
    [email protected]



  2. #2
    Guest
    Normally, if there exists a 1 to many relationship, the
    Database will solve it by one of 2 methods:

    First to teach my grandmother to suck eggs:
    1. Add about a million variables to cover all concievable
    instantiations for the many end;
    2. Have a different table to represent the many end. Each
    record is keyed in such a manner as to make it retrievable.

    Presumably, you've thought of both methods and have
    discarded each for good reasons.

    There is a 3rd method. In the CAR example you could have a
    delimited string represent the tires or sparkplugs, or
    windows, or whathave you. Essentially, a delimited string
    will represent the entries of a separate table. Each sub-
    grouping of the string represents one of the objects in
    exactly the same manner that a separate table does, but the
    data is immediately available to the user. There is no
    need for a retrieval.

    If your interested, I have a suite of tools to deal with
    delimited strings.

    Good Luck
    DerFarm

Posting Permissions

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



Click Here to Expand Forum to Full Width