Subject Re: [IBO] found ibo (?) bug
Author Hundri Magusin
Hi,

Your explanation makes perfect sense, as always. What I find bothersome is
the fact that, to quote, "the
failed locate takes you to the end of the dataset. With a TTable, which a
TIBOTable is supposed to emulate, locate is supposed to behave differently
(or at least that's what I always believed):

(from the online help)

TDataSet.Locate
Implements a virtual method for searching a dataset for a specified record
and makes that record the active record.

function Locate(const KeyFields: string; const KeyValues: Variant; Options:
TLocateOptions): Boolean; virtual;

Description
This function returns False, indicating that a matching record was not found
and the cursor is not repositioned.


Therefore TIBOTable when locate fails it moves to the end, with a normal
dataset, the cursor remains unchanged. I'll be more careful with TIBO now I
guess...

Regards,
Hundri



> You are observing perfectly normal, regular behaviour for TDataset. The
> failed locate takes you to the end of the dataset. Then you place the
> dataset in Edit mode. Because there is no record there, Delphi calls
> Insert instead of Edit and inserts a new row. You immediately call Post
> without adding any data - causing IBO to attempt to post this newly
> inserted record. Because a required field is null, you are getting the
error.
>
> Your assignment statement won't work unless you tell IBO that the field is
> a Boolean - IB has no Boolean type. You would need to set the IB_BOOLEAN
> attribute using the ColumnAttributes property; otherwise your assignment
> statement would need to be
>
> procedure TForm1.IBOTable1BeforePost(DataSet: TDataSet);
> begin
> IBOTable1X.asBoolean:='F';
> end;
>
> By the way, this is not valid SQL in IB 6 or Firebird:
>
> CREATE DOMAIN BOOL AS
> VARCHAR(1)
> DEFAULT "F"
> NOT NULL
> CHECK (VALUE IN ("T","F"))
>
> Strings can not have double-quote delimiters.
>
>
> regards,
> Helen Borrie (TeamIBO Support)
>
> ** Please don't email your support questions privately **
> Ask on the list and everyone benefits
> Don't forget the IB Objects online FAQ - link from any page at
> www.ibobjects.com
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>