Auntiejack56
Registered User.
- Local time
- Today, 11:21
- Joined
- Aug 7, 2017
- Messages
- 177
Hi,
If I create a table in SQL Server Express as below with a default getdate(), and link it in Access, I can add new records via Access, but not update any - instead I get the 'this record has been changed by another user ...'. Changing the default to CURRENT_TIMESTAMP in SQL doesn't work either.
If I add records to the table in SSMS, they get flagged with a red exclamation triangle saying "This row was successfully committed to the database. However a problem occurred when attempting to retrieve the data back after the commit. Because of this the displayed data in this row is read only."
Going back to Access, if I close the table and reopen it, some records are updatable and some are not.
I can work around the problem by either
a) removing the default altogether,
or
b) adding a Timestamp field at the end of the table.
Does anybody know why this might be happening, and if there is a more elegant way to resolve this?
Thanks,
Jack
If I create a table in SQL Server Express as below with a default getdate(), and link it in Access, I can add new records via Access, but not update any - instead I get the 'this record has been changed by another user ...'. Changing the default to CURRENT_TIMESTAMP in SQL doesn't work either.
If I add records to the table in SSMS, they get flagged with a red exclamation triangle saying "This row was successfully committed to the database. However a problem occurred when attempting to retrieve the data back after the commit. Because of this the displayed data in this row is read only."
Going back to Access, if I close the table and reopen it, some records are updatable and some are not.
I can work around the problem by either
a) removing the default altogether,
or
b) adding a Timestamp field at the end of the table.
Does anybody know why this might be happening, and if there is a more elegant way to resolve this?
Thanks,
Jack
SQL:
CREATE TABLE [dbo].[tblDropOffClients](
[ID] [int] IDENTITY(1,1) NOT NULL,
[SessionID] [int] NOT NULL,
[ClientID] [int] NOT NULL,
[DropLocation] [nvarchar](255) NULL,
[DropTime] [datetime2](7) NULL,
CONSTRAINT [PK_tblDropOffClients] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tblDropOffClients] ADD CONSTRAINT [DF_tblDropOffClients_SessionID] DEFAULT ((0)) FOR [SessionID]
GO
ALTER TABLE [dbo].[tblDropOffClients] ADD CONSTRAINT [DF_tblDropOffClients_ClientID] DEFAULT ((0)) FOR [ClientID]
GO
ALTER TABLE [dbo].[tblDropOffClients] ADD CONSTRAINT [DF_tblDropOffClients_DropTime] DEFAULT (getdate()) FOR [DropTime]
GO