Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Setting Relationship type in code (XP)

    I have created a procedure that makes schema mofications in the backend using tables in the front end to define the schema. It works pretty well but I have just one little issue left I can't find the constant for reationship types. so far Ive got -
    Select Case !Relationship_Type
    Case "DontEnforce"
    intRelationshipType = 2
    Case "CascadeUpdate"
    intRelationshipType = 256
    Case "CascadeDelete"
    intRelationshipType = 4096
    Case "CascadeBoth"
    ' intRelationshipType = ?
    End Select
    So I still need the value for Cascade both delete and Update. Where could I find this for myself preferably the constants in case the values change in future versions

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Relationship type in code (XP)

    In DAO, the following constants are available:

    dbRelationDontEnforce = 2
    dbRelationUpdateCascade =256
    dbRelationDeleteCascade = 4096
    (There are a few more, but these ar the relevant ones)
    You can add them together: dbRelationUpdateCascade + dbRelationDeleteCascade = 256+4096 = 4352. This corresponds to "cascade both".

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Setting Relationship type in code (XP)

    Thanks Hans - is ther somewhere I can look up these constants? I tried the object browser and the MS web site with no success.

  4. #4
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting Relationship type in code (XP)

    There's this site written by Terry Wickenden, that is quite up-to-date.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Relationship type in code (XP)

    If you set a reference to the Microsoft DAO 3.6 Object Library (in Tools | References), you should be able to find these constants in the object browser.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Relationship type in code (XP)

    Terry Wickenden's site is about the acCmd... constants used with the RunCommand method, it doesn't deal with DAO as far as I can tell.

  7. #7
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Setting Relationship type in code (XP)

    Found them in the object browser under RelationAttributeEnum
    Thanks

  8. #8
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting Relationship type in code (XP)

    Sorry.......very badly mis-read the question......I'll <img src=/S/hushmouth.gif border=0 alt=hushmouth width=16 height=16> and crawl back under my rock <img src=/S/hiding.gif border=0 alt=hiding width=70 height=24>
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Relationship type in code (XP)

    Don't worry, the link is very useful in itself, since the built-in help for RunCommand is underwhelming. The site has been part of my Favorites many years now!

Posting Permissions

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