enderland
enderland

Reputation: 14165

Why is one of my SQL tables not allowing me to update in spreadsheet view in MS Access?

Situation:

Problem:

I am creating the table using:

CREATE TABLE ProjectApprovers (
    ProjectCode varchar(50) FOREIGN KEY REFERENCES ProjectCodes(ProjectCode),
    RACFApprover varchar(50)
);

The reason I am confused is that it does not appear to be a SQL permissions problem because I can run the following code in Access:

INSERT INTO ProjectApprovers (ProjectCode,RACFApprover) VALUES ('ValidProjectCode','test123');

It seems these restrictions are only limited to the spreadsheet view. Additionally, identical syntax is used to create other tables which do not have this problem.

I am using this code to link my database tables.

Is something like this a permission problem? I have never referenced this problem table with permissions.

Upvotes: 0

Views: 541

Answers (1)

HansUp
HansUp

Reputation: 97131

If Access doesn't recognize a primary key in the linked table, it will present the table as read-only in Datasheet View.

Fix this by adding a primary key in SQL Server. Then recreate the link in Access so it can notice the changed table structure.

Upvotes: 2

Related Questions