Access ODBC can't edit all the tables

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I have an ODBC link to an SQL table in Access.
I am able to edit some of my tables, but can't edit all
of them, particularly the larger ones. What causes this.
Some of the tables that can't be edited don't have key fields.
Would this cause these sorts of problems?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
"Some of the tables that can't be edited don't have key fields.
Would this cause these sorts of problems? "

The key fields are very important in table relationship. If your forms are source from a query whose tables have no PKs, you will have troubles editing or editing data on those tables.

Sincerely,
Ed
Most Valuable Expert 2012
Top Expert 2014
Commented:
SQL Server (and most other server-type database engines) require that you have a Primary Key defined on the table in order to be able to edit them. Note that when you link a SQL table, you can define a "unique index" on that table, which may allow you to actually update it. You can try adding an index to your linked table (Access will complain, but try it anyway) and see if that resolves it. If not, then you'd have to modify the SQL table to include a primary key.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
<<If not, then you'd have to modify the SQL table to include a primary key. >>

 Or just add a timestamp field, which allows Access to to row versioning and be able to update the table.

Jim.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Murray BrownASP.net/VSTO Developer

Author

Commented:
thanks very much

Commented:
Just to correct something that was said above. SQL Server (as with any SQL DBMS) does not require a primary key to allow you to update a table. That's a limitation imposed by Access linked tables - unless you use SQL passthrough or stored procedures you can't normally update a table without an identifiable uniqueness constraint. It is of course a good idea to ensure that every table has a key anyway! :)
Murray BrownASP.net/VSTO Developer

Author

Commented:
Thanks very much for the additional information.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial