Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    9

    Lightbulb Unanswered: ADO/ADOX: referential integrity; one-to-one relation; column indexes

    I am trying to compare two different versions of an Access97 database in order to obtain their differences and then update a database from those differences. And I got those problems:

    1.- How can I change the column index? I mean, in ADOX the indexes of a column collection are ordered by name, and they are not the real indexes. In DAO it was possible to set and get the real index of the column in the table, but with ADOX I cannot see how to do it. Is it possible??? How???

    2.- Is it possible to create a relation one-to-one?? I tried with keys. It is supposed that when you create a "foreign key" between two columns that are unique, the relation becomes unique (a "unique key" is created atomatically at least when I do it via Access). When I create that foreign key, strange things happen. I create it with ADOX and when I see the relations with access, it appears as one-to-multiple (drawn like 1 to infinite), but when I edit the relation it says it is ono-to-one!!!!! Does anybody how to do this?? Is this a bug??

    3.- Is it possible to create a relation with no referential integrity? How?

    Thank you

  2. #2
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238

    Re: ADO/ADOX: referential integrity; one-to-one relation; column indexes

    Originally posted by pabgarde
    I am trying to compare two different versions of an Access97 database in order to obtain their differences and then update a database from those differences. And I got those problems:

    1.- How can I change the column index? I mean, in ADOX the indexes of a column collection are ordered by name, and they are not the real indexes. In DAO it was possible to set and get the real index of the column in the table, but with ADOX I cannot see how to do it. Is it possible??? How???

    2.- Is it possible to create a relation one-to-one?? I tried with keys. It is supposed that when you create a "foreign key" between two columns that are unique, the relation becomes unique (a "unique key" is created atomatically at least when I do it via Access). When I create that foreign key, strange things happen. I create it with ADOX and when I see the relations with access, it appears as one-to-multiple (drawn like 1 to infinite), but when I edit the relation it says it is ono-to-one!!!!! Does anybody how to do this?? Is this a bug??

    3.- Is it possible to create a relation with no referential integrity? How?

    Thank you
    1) ADOX is good for looping through the database structure, but to change the structure it is better to use a data definition query such as:

    ALTER INDEX NewIndex
    ON Friends ([LastName], [FirstName]);

    2) A one-to-one relationship is best created in Access relationship screen. You will need to link on the primary key of each table other wise it will try to create a one-to-many. Are you sure you need a one-to-one relationship? It is quite an unusual database structure that needs a one-to-one relationship.

    3) I assume you mean enforced referential integrity - this can be disabled in the relationship screen in access when you create or edit a relationship

  3. #3
    Join Date
    Nov 2003
    Posts
    9

    Re: ADO/ADOX: referential integrity; one-to-one relation; column indexes

    I don't mind if I really need a one-to-one relationship and I also know it is unusual, but I cannot change the database and it has a one-to-one relation that I have to create.

    And I don't want to use access to change referential integrity nor one-to-one relationship. I need to do it using ADOX and not access (there is no problem doing it with access).

    Anyways thanks

Posting Permissions

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