Re: Trigger makes update impossible

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



That makes sense.

The SQL Server import wizard translates Access Yes/No columns as
nullable bits. That is the source of the issue, and so I expect this
happens to everyone that imports Access tables to SQL Server in this
way.

On Apr 30, 10:27 am, "Sylvain Lafontaine"
<sylvainlafontaine2...@xxxxxxxx> wrote:
Nullable Bit columns (a Bit column that can be set to the Null value) are a
common source of problem.  It's better to not have nullable Bit column and
set their default value to either 0 or 1.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)

"Kipp Woodard" <kip...@xxxxxxxxx> wrote in message

news:775c7f2a-bd6d-4645-bb84-8f35644ea0ff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
It was apparently due to having a column defined as "bit".  I changed
it to "int" and the issue went away.

On Apr 30, 8:55 am, Kipp Woodard <kip...@xxxxxxxxx> wrote:



Sorry, it isn't the trigger. I have removed the trigger and I still
have the same issue. I can't delete a record either. I get:

The Microsoft Access database engine stopped the process because you
and another user are attempting to change the same data at the same
time. (Error 3197)

On Apr 30, 8:21 am, Kipp Woodard

<KippWood...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have an Access 2007 front-end, with a SQL Server 2008 back-end.

I want to update a timestamp on my table when a record is updated using
the
Access front-end.

I have this trigger:

==BEGIN CODE =============================

ALTER TRIGGER [dbo].[t_TimeLog_u]
ON [dbo].[TimeLog]
after Update
AS
BEGIN
SET NOCOUNT ON;

Update TimeLog Set
OutLoginID = suser_sname(),
OutTimestamp = getdate()
From inserted
Where inserted.EventID = TimeLog.EventID
END

==END CODE =============================

I get this message when I update a record:

==BEGIN MESSAGE==================================
Write Conflict

This record has been changed by another user since you started editing
it.
If you save the record, you wilol overwrite the changes the other user
made.

Copying the changes to the clipboard will let you look at the values the
other user entered, and then paste your changes back in if you decide to
make
changes.

Save Record (disabled, can't choose it), Copy to Clipboard, Drop Changes

==END MESSAGE==================================

The end result is I can't have the trigger and update the table too.

Is there a way around this?- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -

.



Relevant Pages

  • Re: Migration Access97 *.mde db in SQLServer2005
    ... Microsoft Access or SQL Server 2005: ... FMS Upsizing Center ... Sylvain Lafontaine, ing. ... Independent consultant and remote programming for Access and SQL-Server ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Access 2003 or 2007 Compatible with SQL Server 2008
    ... SQL-Server 2008 a few weeks ago and I didn't have or see any problem at all. ... Sylvain Lafontaine, ing. ... Did you finally try it in this way: Access 2003 with SQL Server Express ... Our biggest concern is the Compatibility ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Upsizing wizard access Sql Server express
    ... Sylvain Lafontaine, ing. ... Troubleshooting connection problem: ... database into sql server express 2005 by using the upsizing wizardi go ... SQL Server Error: 2 ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Item Cannot be Found in Collection
    ... The "SET NOCOUNT ON" suggestion is not relevant for Access databases. ... setting that can only be performed in SQL Server. ... > I tried Set NOCOUNT = ON and I got a syntax error. ...
    (microsoft.public.scripting.vbscript)
  • Re: Write conflict over-ride?
    ... One easy of checking this would be to take a look with the SQL Server ... unbound form instead of a bound form and make the updates themselves. ... Sylvain Lafontaine, ing. ... I have some code on a subform which changes a record that is displayed on ...
    (microsoft.public.access.adp.sqlserver)