H
Helmut Herrmann
After upgrading from Access 2003/SQL Server 2000 to Access 2007/SQL Server
2005 the following problem occurred:
In some forms with subforms the data source of the main form is a view and
the data source of the subform is a table with a field containing the ID of
the record in the main form. When I insert a new record in the subform this
works well. But when I want to edit this new record, I get the error message
that another user has changed the record which is definitely not true. It is
not possible to save the edited record. I have to leave the record in the
main form and reenter it in order to be able to edit the new record in the
subform.
I used SQL profiler to see what is going on. Regarding insertion of the new
record in the subfrom the profiler recorded the following:
---------
exec sp_executesql N'INSERT INTO "zentraleSQL"."dbo"."t_RECHNUNGS_POS"
("ReID","Pos","Anzahl","Bezeichnung","Einzelpreis","Einheit","Rabatt","MwStSatz","EinzelpreisEuro","Währung","Kurs","Betrag","DatumEingabe")
VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13)',N'@P1
int,@P2 smallint,@P3 real,@P4 nvarchar(10),@P5 money,@P6 nvarchar(5),@P7
int,@P8 real,@P9 money,@P10 nvarchar(3),@P11 float,@P12 float,@P13
datetime',9281,4,1,N'BBBBBBBBBB',$0.0000,N'Stück',0,0,18999999761581421,$0.0000,N'EUR',1,0,'2008-08-27 00:00:00:000'
Error: 156, Severity: 15, State: 1
Falsche Syntax in der Nähe des 'WHERE'-Schlüsselwortes.
(in English something like: Wrong syntax near 'WHERE' keyword.)
exec sp_executesql N'SELECT * FROM (SELECT TOP 100 PERCENT
dbo.t_RECHNUNGS_POS.* FROM dbo.t_RECHNUNGS_POS ORDER BY Pos) WHERE
dbo.t_RECHNUNGS_POS.[Re-PosID] = @P1',N'@P1 int',0
---------
I conlude from this that the resync command of the subform has a problem and
that this is the reason why subsequent attempts to update the new record
fail. The resync command was not necessary with Access 3003/SQL Server 2000.
Can anyone please help me with the resync command? I could not figure out
what I am doing wrong.
Thank you in advance.
2005 the following problem occurred:
In some forms with subforms the data source of the main form is a view and
the data source of the subform is a table with a field containing the ID of
the record in the main form. When I insert a new record in the subform this
works well. But when I want to edit this new record, I get the error message
that another user has changed the record which is definitely not true. It is
not possible to save the edited record. I have to leave the record in the
main form and reenter it in order to be able to edit the new record in the
subform.
I used SQL profiler to see what is going on. Regarding insertion of the new
record in the subfrom the profiler recorded the following:
---------
exec sp_executesql N'INSERT INTO "zentraleSQL"."dbo"."t_RECHNUNGS_POS"
("ReID","Pos","Anzahl","Bezeichnung","Einzelpreis","Einheit","Rabatt","MwStSatz","EinzelpreisEuro","Währung","Kurs","Betrag","DatumEingabe")
VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12,@P13)',N'@P1
int,@P2 smallint,@P3 real,@P4 nvarchar(10),@P5 money,@P6 nvarchar(5),@P7
int,@P8 real,@P9 money,@P10 nvarchar(3),@P11 float,@P12 float,@P13
datetime',9281,4,1,N'BBBBBBBBBB',$0.0000,N'Stück',0,0,18999999761581421,$0.0000,N'EUR',1,0,'2008-08-27 00:00:00:000'
Error: 156, Severity: 15, State: 1
Falsche Syntax in der Nähe des 'WHERE'-Schlüsselwortes.
(in English something like: Wrong syntax near 'WHERE' keyword.)
exec sp_executesql N'SELECT * FROM (SELECT TOP 100 PERCENT
dbo.t_RECHNUNGS_POS.* FROM dbo.t_RECHNUNGS_POS ORDER BY Pos) WHERE
dbo.t_RECHNUNGS_POS.[Re-PosID] = @P1',N'@P1 int',0
---------
I conlude from this that the resync command of the subform has a problem and
that this is the reason why subsequent attempts to update the new record
fail. The resync command was not necessary with Access 3003/SQL Server 2000.
Can anyone please help me with the resync command? I could not figure out
what I am doing wrong.
Thank you in advance.