now all is ok.
thanks a lot.
Claudio
Search found 4 matches
- Fri 14 Dec 2007 14:26
- Forum: SQL Server Data Access Components
- Topic: Unable delete record inserted -
- Replies: 10
- Views: 4888
- Thu 13 Dec 2007 16:39
- Forum: SQL Server Data Access Components
- Topic: Unable delete record inserted -
- Replies: 10
- Views: 4888
- Wed 12 Dec 2007 17:34
- Forum: SQL Server Data Access Components
- Topic: Unable delete record inserted -
- Replies: 10
- Views: 4888
Now I have tried the two solutions with problem.
The second way:
SQL:
SELECT anno, numero, idriga, data, an_conto, datainizio, datafine, utente, creazione, nota, terminato
FROM hhDichiarazioni
where anno=:anno
order by anno, numero
INSERT INTO hhDichiarazioni
(anno, numero, data, an_conto, datainizio, datafine, utente, creazione, nota, Terminato)
VALUES
(:anno, :numero, :data, :an_conto, :datainizio, :datafine, :utente, :creazione, :nota, :Terminato)
SET :idriga = SCOPE_IDENTITY()
procedure TFMain.DichiarazioniBeforeUpdateExecute(Sender: TCustomMSDataSet;
StatementTypes: TStatementTypes; Params: TMSParams);
begin
Params.ParamByName('IDRIGA').ParamType := ptInputOutput;
end;
TMSQuery.ReturnParams option to True;
Now, in this way, I see the correct value of idriga (primary key value) but if I try to delete the record I obtain "PARAMETER IDRIGA NOT FOUND"
Thanks Claudio Cancelli
The second way:
SQL:
SELECT anno, numero, idriga, data, an_conto, datainizio, datafine, utente, creazione, nota, terminato
FROM hhDichiarazioni
where anno=:anno
order by anno, numero
INSERT INTO hhDichiarazioni
(anno, numero, data, an_conto, datainizio, datafine, utente, creazione, nota, Terminato)
VALUES
(:anno, :numero, :data, :an_conto, :datainizio, :datafine, :utente, :creazione, :nota, :Terminato)
SET :idriga = SCOPE_IDENTITY()
procedure TFMain.DichiarazioniBeforeUpdateExecute(Sender: TCustomMSDataSet;
StatementTypes: TStatementTypes; Params: TMSParams);
begin
Params.ParamByName('IDRIGA').ParamType := ptInputOutput;
end;
TMSQuery.ReturnParams option to True;
Now, in this way, I see the correct value of idriga (primary key value) but if I try to delete the record I obtain "PARAMETER IDRIGA NOT FOUND"
Thanks Claudio Cancelli
- Mon 10 Dec 2007 16:17
- Forum: SQL Server Data Access Components
- Topic: Unable delete record inserted -
- Replies: 10
- Views: 4888
Unable delete record inserted -
I have inserted a record, but if I immediately try to delete it, I have the message: "Update fail - 0 records found".
If I refresh the dataset, I can delete the record without problem.
What's the problem?
Thanks
Claudio Cancelli
If I refresh the dataset, I can delete the record without problem.
What's the problem?
Thanks
Claudio Cancelli