cannot delete and update records on access linked table
I SOLVED this by adding primary key to the SQL table and re linked the table to ACCESS
Thanks everyone...
SQL Linked Table Can Insert Can't Delete Run-Time 3086
To delete or update in a linked ODBC table, the table needs to have a Primary Key.
The PK must be recognized by Access: open the linked table in design view, check there is a "lock" icon in the PK column(s).
Access linked table Connect property corrupted - How to fix (or delete)?
I've tried using code to update/restore the 'connection' property but that doesn't work.
I was able to recreate your issue by hacking an .accdb file and setting the .Connect
property of a linked table to Null
. Although ...
I was unable to delete the link (I got "Invalid use of Null", same as you), and
Compact and Repair Database did not fix the problem
... I was able to revive the link with the following VBA code:
Option Compare Database
Option Explicit
Sub ReviveBadLink()
Dim cdb As DAO.Database
Set cdb = CurrentDb
Dim tbd As DAO.TableDef
Set tbd = cdb.TableDefs("Clients")
tbd.Connect = ";Database=C:\Users\Public\Database1.accdb"
tbd.RefreshLink
End Sub
Once the link was revived I could then delete it as usual.
Related Topics
Order by Column1 If Column1 Is Not Null, Otherwise Order by Column2
How to Count Most Consecutive Occurrences of a Value in a Column in SQL Server
How to Get Rightmost 10 Places of a String in Oracle
Sql Server Bug or Feature? Decimal Numbers Conversion
Sqlite: Autoincrement Primary Key Questions
Is Postgresql Order Fully Guaranteed If Sorting on a Non-Unique Attribute
How to Select The First 100 Characters in SQL Server
How to Use Group_Concat in Rails
Oracle SQL to Sort Version Numbers
Change Data Type Varchar to Varbinary(Max) in SQL Server
Sql Server Row Date Last Modified
Sql Server Table Locks in Long Query - Solution: Nolock
Sql Order by on Multiple Column
Get The Type of a Variable in MySQL
Cast Collation of Nvarchar Variables in T-Sql
Datareader.Getfieldtype Returned Null
Create Geometry/Geography Field from Latitude & Longitude Fields (Sql Server)