Cascading Updates? turn on?

Results 1 to 2 of 2

Thread: Cascading Updates? turn on?

  1. #1
    Join Date
    Dec 1969

    Default Cascading Updates? turn on?

    Now I don&#039;t understand why the heck this is happening<BR><BR>strSQL = "SELECT, [password], [first name], [last name], [email address], [address], [city], [state], " & _<BR> "[zip], [country], [phone number], [password], [gender], [martial status], [birth date], [ip address], [ssn" & _<BR> "], [date joined], [referred], [referredby] FROM users INNER JOIN userstats ON = WHERE = " & iReferredBy<BR><BR>That was working...I changed a bit the code and now I get an error saying "the field cannot be updated" when I am adding a new recordset. <BR>I read the faqs:<BR>*********************<BR>QUESTION:<BR>Why am I getting "Operation must use an updateable query" errors? <BR>ANSWER:<BR>One cause does have a robust workaround. If you try to update a join field on the "one" side of a "one-to-many" query it will fail unless you turn on cascading updates. This way, you delegate referential integrity to the JET engine.<BR>************************<BR>I think this is my work around! but what the heck are cascading updates and how do I set them to ON??<BR><BR>I have worked on this error for 6 hours, now I am getting a bit bored...please help or I might throw my body out of the window :)<BR>

  2. #2
    Join Date
    Dec 1969

    Default You could, but won't help...

    Normally, you can NOT update records that result from a JOIN. It is possible that Access and/or SQL Server allow this, but it is not standard.<BR><BR>Normally, you must update each table separately, being careful to update the "parent" table (the one with the primary key) first and then all the "children" (the ones with foreign keys), *unless* you are changing the primary key. Which I sure hope you aren&#039;t doing.<BR><BR>But a cascade update simply means that, when you change the primary key of the parent table, all the child records (referring to the record with that primary key via foreign keys) automatically have their referring field (the foreign key) updated. In your case, that would appear to be the ".id" field in the two tables, meaning that unless your UPDATE is changing *that* field then the cascade update wouldn&#039;t do anything different, anyway. So I&#039;d bet that you simply can&#039;t update a recordset created via a join.<BR><BR>

Posting Permissions

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