Search found 4 matches

by claudio.cancelli
Fri 14 Dec 2007 14:26
Forum: SQL Server Data Access Components
Topic: Unable delete record inserted -
Replies: 10
Views: 4888

now all is ok.

thanks a lot.

Claudio
by claudio.cancelli
Thu 13 Dec 2007 16:39
Forum: SQL Server Data Access Components
Topic: Unable delete record inserted -
Replies: 10
Views: 4888

If I write:

if stUpdate in StatementTypes then
Params.ParamByName('IDRIGA').ParamType := ptInputOutput;

Now I don't see the value of IDRIGA after post and if I try to delete the record, I obtain "UPDATE FAILED - FOUND 0 RECORDS"
by claudio.cancelli
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
by 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