Related Tables??

Results 1 to 2 of 2

Thread: Related Tables??

  1. #1
    Join Date
    Dec 1969

    Default Related Tables??

    I have a db consisting of related tables. I've created an ASP page which will modify a table within the db, but every time I try the modifying I get an error msg saying that table has related records and therefore no modifying is allowed.. is there a solution to overcome this??

  2. #2
    Join Date
    Dec 1969

    Default Modifying wrong thing?

    If two tables are related, and if you have asked the DB to enforce referential integrity, then you can&#039;t modify the field in table1 that is being used by table2 as a foreign key into table1.<BR><BR>Example:<BR><BR>Table: Customers<BR> custNo : number<BR> custName : text<BR> custAddr : text<BR> ...<BR><BR>Table: Invoices<BR> invNo : number<BR> custNo : number &#039; &#060;&#060;&#060; foreign key to Customers table!<BR> invDate : datetime<BR> ...<BR><BR>In this pair of tables, you should be able to change anything in the Invoices table without the Customers table caring. <BR><BR>And you should be able to change anything in the Customers table *EXCEPT* the custID without the Invoices table caring.<BR><BR>SO...<BR><BR>If you are getting that message, it must be because you are attempting to change something in one table that another table *does* care about.<BR><BR>And that probably means that you are screwing up. Possibly, you are doing the modification inadvertently? (A common mistake is to update a table, assigning the *same value* back to the key field. *You* know you haven&#039;t changed anything, but the DB thinks you are attempting to change the key and yells at you.)<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