Subject | found ibo (?) bug |
---|---|
Author | Hundri Magusin |
Post date | 2002-05-21T15:54:08Z |
I've stumbled upon a bug. It's quite easy to reproduce:
1. Create a table having a "boolean" field:
CREATE TABLE COUNTRIES (
ID INTEGER NOT NULL,
NAME VARCHAR(60),
X BOOL NOT NULL);
CREATE DOMAIN BOOL AS
VARCHAR(1)
DEFAULT "F"
NOT NULL
CHECK (VALUE IN ("T","F"))
2. Drop a TIBOTable and a tbutton
procedure TForm1.Button1Click(Sender: TObject);
begin
with IBOTable1 do
begin
open;
first;
showmessage('1st time: '+IBOTable1NAME.asString); // valid, all well
Edit;
Post;
Locate('ID', 0, []); // non existant row
showmessage('2nd time: '+IBOTable1NAME.asString); // valid, still shows
the same as before
Edit;
Post; // exception here: "X is a required field"
end;
Cheers.
end;
adding :
procedure TForm1.IBOTable1BeforePost(DataSet: TDataSet);
begin
IBOTable1X.asBoolean:=false;
end;
makes no difference.
1. Create a table having a "boolean" field:
CREATE TABLE COUNTRIES (
ID INTEGER NOT NULL,
NAME VARCHAR(60),
X BOOL NOT NULL);
CREATE DOMAIN BOOL AS
VARCHAR(1)
DEFAULT "F"
NOT NULL
CHECK (VALUE IN ("T","F"))
2. Drop a TIBOTable and a tbutton
procedure TForm1.Button1Click(Sender: TObject);
begin
with IBOTable1 do
begin
open;
first;
showmessage('1st time: '+IBOTable1NAME.asString); // valid, all well
Edit;
Post;
Locate('ID', 0, []); // non existant row
showmessage('2nd time: '+IBOTable1NAME.asString); // valid, still shows
the same as before
Edit;
Post; // exception here: "X is a required field"
end;
Cheers.
end;
adding :
procedure TForm1.IBOTable1BeforePost(DataSet: TDataSet);
begin
IBOTable1X.asBoolean:=false;
end;
makes no difference.