QUOTE(owam @ 26 Oct, 2007 - 09:33 AM)

something like this should work but it doesnt. buf_property is the name of the table i am trying to read from and PropertyDetails is just a declaration. loSourceData and loDestData refer to units that we created at work. Now Prop_Seq_no, Property_id and Property_name are the details that i want to retrive from the table. I am actually copying from loSourceData to loDestData info stored in buf_property
Your response will be highly appreciated.
{copying buf_property }
if PropertyDetails then
begin
loSourceData := loSourcePart2.DatasetByName('buf_property');
loDestData := loDestPart2.DatasetByName('buf_property');
if assigned(loSourceData) and not loSourceData.IsEmpty then
begin
loSourceData.first;
while not loSourceData.Eof do
begin
if not (loDestData.State in [dsInsert, dsEdit]) then
loDestData.Insert;
loDestData.FieldByName('Prop_Seq_No').AsInteger := loSourceData.FieldByName('Prop_Seq_No').AsInteger;
loDestData.FieldByName('Property_Id').AsInteger := loSourceData.FieldByName('Property_Id').AsInteger;
loDestdata.FieldByName('Property_Name').AsString := loSourcedata.FieldByName('Property_Name').AsString;
loSourceData.Next;
end;
end;
end;
try
CODE
...
loDestdata.FieldByName('Property_Name').AsString :=
loSourcedata.FieldByName('Property_Name').AsString;
loDestData.Post;
loSourceData.Next;
end;
loDestData.ApplyUpdates;
end;
end;
This post has been edited by Levaquin: 29 Nov, 2007 - 01:29 PM