Results 1 to 3 of 3

Thread: Trigger and VB Code locking horns

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2003
    Posts
    3

    Trigger and VB Code locking horns

    I have an invoice form with two ado controls on it, one for the overall invoice information, like the ID number, customer, etc., and the other for the line items.

    This form has been working without a problem until I recently added an update trigger to the orders table. The trigger responds to changes in an order's Status field. If Status is changed to "VOID", the trigger looks at each line item associated with this order, and increases the OnHand counter for each of the corresponding products by the Quantity in the line item. And it does the opposite if the status is changed from "VOID" to anything else. When I test this trigger in the SQL Enterprise Manager, it operates perfectly.

    However, when I run my VB application and change the Status of an Invoice to or from "VOID", I get the following error message:

    "Key column information is insufficient or incorrect. Too many rows were affected by update."

    Thanks in advance for any ideas about what's causing this and what I can do about it.

  2. #2
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    Try adding a primary key on the table you are updating and see what happens.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2003
    Posts
    3

    Unhappy

    All my tables already have primary key fields.

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