Programatically add a constraint. ADOX?



Dear group.

Thansk for your help. Now, I try to do this

ALTER TABLE [Kørsler]
ADD CONSTRAINT RunIDRef
FOREIGN KEY ([KørselsID])
REFERENCES Posteringer ([KørselsID])
ON DELETE CASCADE ON UPDATE CASCADE

but get problems with Access because of the use of the Danish letter "ø" (ie
a letter outside the A-Z range). Normally Access will allow me to use
letters like that, as long as I enclose names in square bracket, as
illustrated above.

But with this code, I get an error message telling me, that "KørselsID" is
an illegal name for creating a constraint.

Unfortunaltely, it is too late for me to change the names of the tables and
fields.

A few days ago, I got kind help on how to drop constraints. My troubles
turned out to be related to this problem too. Now, can you help me with this
problem? Can I do this thing using ADOX ? Could you perhaps point me to som
code examples?

Cheers
Jacob


.



Relevant Pages

  • RE: Creating a recurring task
    ... Earlier Than" constraint on them. ... "Chop Lettuce" task, the remainder do not cascade (they are locked by the ... I suggest you make a template of the entire day. ...
    (microsoft.public.project)
  • Re: multiple cascade paths
    ... You should not have them if your schema is designed properly. ... constraint fk1 foreign keyreferences depton ... update cascade on delete cascade, ...
    (comp.databases.ms-sqlserver)
  • Re: delete cascade
    ... The normal effect of a constraint is simply to block any inconsistent update. ... You gave an english phrase suggesting all foreign keys should cascade deletes, and I gave a similar english phrase suggesting they should not. ... Maybe what I was confusing was what SQL is versus what I think it should be. ... The latest chatter about transactions reminds me that I could just as well have complained about the difficulty of inserting invoice items before an invoice is inserted. ...
    (comp.databases.theory)
  • Re: delete cascade
    ... It seems to me there is only one logical constraint ... You gave an english phrase suggesting all foreign keys should cascade deletes, and I gave a similar english phrase suggesting they should not. ... If one wants "on delete cascase", one can present a view with the invoice items as an RVA. ...
    (comp.databases.theory)
  • Re: Creating a recurring task
    ... Earlier Than" constraint on them. ... "Chop Lettuce" task, the remainder do not cascade (they are locked by the ... I suggest you make a template of the entire day. ...
    (microsoft.public.project)