SQLDelete

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
trayal
Posts: 8
Joined: Wed 01 Jun 2005 09:31

Post by trayal » Thu 02 Jun 2005 04:18

SDAC Help:
Use SQLDelete property to specify SQL statement that will be used when applying a deletion to a record
Also, when you executed

Code: Select all

Dm.Trengpol.Delete
,
then Dm.Trengpol.SQLdelete code execute

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 02 Jun 2005 07:07

SQLDelete etc queries are processed automatically on execution Delete, Post, RefreshRecord. Usually there is no need to fill these properties as text of the query is generated automatically.

Use the next sequence:

Code: Select all

Dm.Trengpol.SQL.Clear; 
Dm.Trengpol.SQL.Add('Delete from CRENGPOL where NUMPOL = '+Epoliza.Text); 
Dm.Trengpol.Execute; 

maciejw
Posts: 11
Joined: Sun 20 Mar 2005 10:37
Location: Poland
Contact:

Post by maciejw » Sat 11 Jun 2005 09:27

instead of
Dm.Trengpol.SQL.Clear;
Dm.Trengpol.SQL.Add('Delete from CRENGPOL where NUMPOL = '+Epoliza.Text);
Dm.Trengpol.Execute;
you can use separate TMsSQL component (f.e. named TheSQL):

Dm.TheSQL.SQL.Text := 'Delete from CRENGPOL where NUMPOL = '+Epoliza.Text;
Dm.TheSQL.Execute;
Dm.Trengpol.Refresh;

Post Reply