X-POP3-Rcpt: r.p.sterkenburg@clausplein
Return-Path: keeper@mindspring.com
X-Sender: keeper@mindspring.com
Date: Tue, 19 Mar 1996 18:22:47 -0600
To: r.p.sterkenburg@dataweb.nl (R.P. Sterkenburg)
From: Mark Johnson <keeper@mindspring.com>
Subject: BUG REPORT

NAME = Samuel Natali Junior
EMAIL = samjr@ibm.net
email-address = nobody@166.72.32.111
CATEGORY = Visual Component Library (VCL)
BUG = VLC DBEDIT x MESSAGEDLG
DESCRIPTION = When I call the function MessageDlg (or any other Message
functions)
in the dbedit.Exit event, the second dbEdit field does not change the
modifications in database. 

To resolve this problem, I insert this line:

	Procedure TForm1.DBEdit2Change(Sender: TObject);
	begin
         	dbEdit2.Field.AsString:=dbEdit2.Text;
    	end;

This sample program demonstrate this problem.

================================
        The File LIXOS.DPR
================================

program Lixos;

uses
  Forms,
  Lixo in 'LIXO.PAS' {Form1};

{$R *.RES}

begin
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

================================
        The File LIXO.DFM
================================

object Form1: TForm1
  Left = 333
  Top = 193
  Width = 358
  Height = 161
  Caption = 'Form1'
  Font.Color = clWindowText
  Font.Height = -13
  Font.Name = 'System'
  Font.Style = []
  PixelsPerInch = 96
  OnShow = FormShow
  TextHeight = 16
  object Label1: TLabel
    Left = 10
    Top = 25
    Width = 48
    Height = 16
    Caption = 'Field 1:'
  end
  object Label2: TLabel
    Left = 10
    Top = 60
    Width = 48
    Height = 16
    Caption = 'Field 2:'
  end
  object Label3: TLabel
    Left = 10
    Top = 95
    Width = 48
    Height = 16
    Caption = 'Field 3:'
  end
  object DBText1: TDBText
    Left = 195
    Top = 30
    Width = 65
    Height = 17
    DataField = 'Field1'
    DataSource = DataSource1
  end
  object DBText2: TDBText
    Left = 195
    Top = 65
    Width = 65
    Height = 17
    DataField = 'Field2'
    DataSource = DataSource1
  end
  object DBText3: TDBText
    Left = 195
    Top = 100
    Width = 65
    Height = 17
    DataField = 'Field3'
    DataSource = DataSource1
  end
  object Label4: TLabel
    Left = 75
    Top = 5
    Width = 61
    Height = 16
    Caption = 'Edit Field'
  end
  object Label5: TLabel
    Left = 195
    Top = 5
    Width = 98
    Height = 16
    Caption = 'Database Field'
  end
  object DBEdit1: TDBEdit
    Left = 70
    Top = 25
    Width = 121
    Height = 24
    DataField = 'Field1'
    DataSource = DataSource1
    MaxLength = 0
    TabOrder = 0
    OnExit = DBEdit1Exit
  end
  object DBEdit2: TDBEdit
    Left = 70
    Top = 60
    Width = 121
    Height = 24
    DataField = 'Field2'
    DataSource = DataSource1
    MaxLength = 0
    TabOrder = 1
  end
  object DBEdit3: TDBEdit
    Left = 70
    Top = 95
    Width = 121
    Height = 24
    DataField = 'Field3'
    DataSource = DataSource1
    MaxLength = 0
    TabOrder = 2
  end
  object Table1: TTable
    BeforeOpen = Table1BeforeOpen
    TableName = 'LIXO.DB'
    Left = 265
    object Table1Field1: TStringField
      FieldName = 'Field1'
      Size = 10
    end
    object Table1Field2: TStringField
      FieldName = 'Field2'
      Size = 10
    end
    object Table1Field3: TStringField
      FieldName = 'Field3'
      Size = 10
    end
  end
  object DataSource1: TDataSource
    DataSet = Table1
    Left = 295
  end
  object Query1: TQuery
    Left = 320
  end
end


================================
        The File LIXO.PAS
================================
unit Lixo;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, Mask, DBCtrls, DB, DBTables;

type
  TForm1 = class(TForm)
    Table1: TTable;
    Table1Field1: TStringField;
    Table1Field2: TStringField;
    Table1Field3: TStringField;
    DataSource1: TDataSource;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Query1: TQuery;
    DBText1: TDBText;
    DBText2: TDBText;
    DBText3: TDBText;
    Label4: TLabel;
    Label5: TLabel;
    procedure DBEdit1Exit(Sender: TObject);
    procedure Table1BeforeOpen(DataSet: TDataset);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}


Procedure TForm1.DBEdit1Exit(Sender: TObject);
begin
     MessageDlg('Go to Next Field', mtInformation,[mbOK],0)
end;

procedure TForm1.Table1BeforeOpen(DataSet: TDataset);
begin
     DeleteFile('LIXO.DB');
     Query1.SQL.Clear;
     Query1.SQL.Add('CREATE TABLE LIXO (FIELD1 CHAR(10),');
     Query1.SQL.Add('FIELD2 CHAR(10),');
     Query1.SQL.Add('FIELD3 CHAR(10) )');
     Query1.ExecSQL;
     Query1.Close;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
     Table1.Open;
end;

end.

CONFIRMED = Yes
COMPUTERS = 6
SOLUTION = To resolve this problem, I insert this line:

	Procedure TForm1.DBEdit2Change(Sender: TObject);
	begin
         	dbEdit2.Field.AsString:=dbEdit2.Text;
    	end;


______________________________________________________________________________
_/_/ Mark R. Johnson       _/_/ "Move and your dead!"                     _/_/
_/_/ Atlanta, GA USA       _/_/ "And I say I'm dead, and I move."         _/_/
_/_/ keeper@mindspring.com _/_/                  - Brandon Lee, The Crow  _/_/

