Delete Problem When Migrating from MS Access 2003 to MS SQL 2005

  • gedlar (12/23/2008)


    Matt Miller (12/23/2008)


    If you're trying to delete "from the user interface" - you mean deleting rows from the Access interface in linked tables?

    Yes

    If you don't have primary keys set up (or didn't identify one or more columns to ACT as a primary key), the linked tables are de facto read-only. If that's the case, then drop and add the linked tables again. When it prompts you for what columns "are unique", make sure to pick a good combination.

    Here's the situation. There's a parent table called TBLEvents, which uses the primary key called ERecordNo. ERecordNo is pointing to a child table called TBLeventsDiversity. I'm trying to delete a record from this child table, which should not necessarily have a unique key. Are you saying I need to pick two keys to make this work?

    I'm saying that in the linked table scenario you're in, if Access doesn't think it can uniquely identify which row to kill, it's not going to let you delete from that table.

    In this particular scenario - I'd ADD an identity column to the EventsDiversity table, and call it the primary key (if there's nothing else that's unique for sure).

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • I'm saying that in the linked table scenario you're in, if Access doesn't think it can uniquely identify which row to kill, it's not going to let you delete from that table.

    In this particular scenario - I'd ADD an identity column to the EventsDiversity table, and call it the primary key (if there's nothing else that's unique for sure).

    That means I should be able to delete a record from a table that has a primary key, right? So I tried to delete a record in TBLEvents, since I know for a fact it has a primary key. And sure enough, it did delete it. It looks like there is some truth in what you say.

    But I still have a problem. There should be a way to delete multiple records in a table that have the same key.

  • I'd like to thank you all for your input. I fixed the problem now.

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply