Subject Re: [IBO] OnDataChange and refreshing data in query linked with KeySource
Author tomjanczkadao
>
> Are you talking about the timing of the firing of the OnDataChange
event in
> relation to the timing of when the linking relationship to the other
side of
> the KeyLinks relationship?
>
> Perhaps you could send me a sample application showing how it works
and tell
> me how you want it to work. I'll see if there is something in IBO
that I
> can adjust to get more ideal timing of events.
>
> Jason Wharton
>

i've sent example at @... and piece of sample code
there:

table USERS:
NAME CITY(fk)
Alan Miami
Frank Miami
Greg San Francisco
John Los Angeles

table CITIES:
CITY STATE
Houston Texas
Los Angeles California
Miami Florida
San Francisco California

procedure TForm1.FormCreate(Sender: TObject);
begin
conn.Connect;

qUsers.SQL.Text := 'SELECT name, city FROM users';
qUsers.Open;

qCities.SQL.Text := 'SELECT city, state FROM cities';
qCities.KeySource := dsUsers;
qCities.KeyLinks.Text := 'city=city';
qCities.Open;

end;

procedure TForm1.dsUsersDataChange(Sender: TIB_StatementLink;
Statement: TIB_Statement; Field: TIB_Column);
begin
if qCities.Active and qUsers.Active then
ShowMessage(qCities.FieldByName('city').AsString + #13#10 +
qUsers.FieldByName('city').AsString);
{
if I scroll qUsers from John (Los Angeles) to Alan (Miami)
Showmessage says:
"Los Angeles
Miami"
but it should be same value "Miami"
So if i check field 'State' from 'Cities' it'll return incorect value
}
end;

Regards, Tomek