Re: BIG BUG in Deleting detali records
- From: "Cavalera Guido" <cavaleraguido@xxxxxxxxxxxx>
- Date: Wed, 23 May 2007 18:03:00 +0200
Excuse me can u try to compile this code ? use a msAccess database and two
tables without relation ... you can see that detail records dont be removed
from the database ..
bye
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, Buttons,adoint;
type
TForm1 = class(TForm)
ADODataSet1: TADODataSet;
DataSource1: TDataSource;
DataSource2: TDataSource;
ADODataSet2: TADODataSet;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
ADOConnection1: TADOConnection;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ADODataSet1BeforeDelete(DataSet: TDataSet);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
adodataset1.open;
adodataset2.open;
adodataset1.IndexFieldNames:='codice1';
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
ADOConnection1.BeginTrans;
adodataset1.delete;
end;
procedure TForm1.ADODataSet1BeforeDelete(DataSet: TDataSet);
begin
adodataset2.First();
while not adodataset2.bof do
adodataset2.Delete;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
adodataset1.UpdateBatch();
adodataset2.UpdateBatch();
ADOConnection1.CommitTrans;
end;
end.
--
Soluzioni Software di Gestione Aziendale
www.OnAzienda.it
"Kevin Frevert" <kevin@xxxxxxxxxxxxxxxxxxxxxxxx> ha scritto nel messaggio
news:465453b3@xxxxxxxxxxxxxxxxxxxxxxxxx
"Cavalera Guido" <cavaleraguido@xxxxxxxxxxxx> wrote in message
news:46536d47@xxxxxxxxxxxxxxxxxxxxxxxxx
with the same object i intend ... Adodataset !
bye
I'm sorry, I don't understand what you are trying to say.
.
- Follow-Ups:
- Re: BIG BUG in Deleting detali records
- From: Kevin Frevert
- Re: BIG BUG in Deleting detali records
- References:
- BIG BUG in Deleting detali records
- From: Cavalera Guido
- Re: BIG BUG in Deleting detali records
- From: Brian Bushay TeamB
- Re: BIG BUG in Deleting detali records
- From: Cavalera Guido
- Re: BIG BUG in Deleting detali records
- From: Cavalera Guido
- Re: BIG BUG in Deleting detali records
- From: Kevin Frevert
- Re: BIG BUG in Deleting detali records
- From: Cavalera Guido
- Re: BIG BUG in Deleting detali records
- From: Kevin Frevert
- BIG BUG in Deleting detali records
- Prev by Date: Re: ADO is a BUG
- Next by Date: Re: ADO is a BUG
- Previous by thread: Re: BIG BUG in Deleting detali records
- Next by thread: Re: BIG BUG in Deleting detali records
- Index(es):