Results 1 to 2 of 2

Thread: Updating more than one table (with Access)

  1. #1

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50

    Question

    I am pretty new to VB, so please excuse the how elementery
    this question may be.

    I am trying to update a database that from a FORM in VB.
    Some of the fields (textboxes in VB) are linked to certain
    tables, others to other tables using the Datafield Property. I am updating through and ADO Data
    Control using Jet 4.0.

    I am trying to update a table called 'ORDERS' that has a
    link to the 'CUSTOMER' table. When I use "enforce
    referential intergrity" in Access, it bombs. The error
    that I get is:

    Run-Time Error: '-2147467259(80004005)':
    You cannot add or change a record because a relaed record
    is required in 'CUSTOMER'.

    I am not updating the Customer table. When I remove the
    referential intergrity, it works, but the related fields
    remain null.

    Thank you for any help.

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    How much do you know about referential integrity?

    Your database is set up so that it requires a CUSTOMER record for every Order record entered. You have 2 choices, you can either remove referential integrity or you can check to see if the customer in your order rec exists and add one if it does not (you could set up a "default" customer that isn't a real customer and use that _or_ ask the user to provide customer data when it's found to be missing).

    [Edited by JHausmann on 08-09-2000 at 05:53 PM]

Posting Permissions

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



Click Here to Expand Forum to Full Width