 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
aaa.aaaa Guest
|
Posted: Wed Jan 18, 2006 3:35 pm Post subject: TCustomADODataSet.Clone and Calculated fields |
|
|
Hy !!!
I would like to know why the clone method of TCustomADODataSet doesn't
clone the Calculated fields
example :
.......
procedure TForm1.Button2Click(Sender: TObject);
var
msg: string;
begin
if m_ADOQuery <> nil then
FreeAndNil(m_ADOQuery);
m_ADOQuery:= TADOQuery.Create(Nil);
Self.ADOQuery1.Open;
m_ADOQuery.Clone(Self.ADOQuery1);
DataSource1.DataSet:= m_ADOQuery;
msg:= 'ADOQuery1 Field Count' + IntToStr(ADOQuery1.Fields.Count);
msg:= msg + #13#10 + 'm_ADOQuery Field Count' +
IntToStr(m_ADOQuery.Fields.Count);
msg:= msg + #13#10 + 'ADOQuery1 FieldDefList Count' +
IntToStr(ADOQuery1.FieldDefList.Count);
msg:= msg + #13#10 + 'm_ADOQuery FieldDefList Count' +
IntToStr(m_ADOQuery.FieldDefList.Count);
MessageDlg(msg, mtInformation, [mbOK], 0); DataSource1.DataSet:= nil;
end;
The Calculated fields are not cloned how can i clone them ?
Thanks
Here bellow a part of the .dfm file
object ADOQuery1: TADOQuery
Connection = ADOConnection1
CursorType = ctStatic
OnCalcFields = ADOQuery1CalcFields
Parameters = <>
SQL.Strings = (
'SELECT EmployeeID, LastName , FirstName ,Title '
'FROM Employees')
Left = 64
Top = 88
object ADOQuery1EmployeeID: TAutoIncField
FieldName = 'EmployeeID'
ReadOnly = True
end
object ADOQuery1LastName: TWideStringField
FieldName = 'LastName'
end
object ADOQuery1FirstName: TWideStringField
FieldName = 'FirstName'
Size = 10
end
object ADOQuery1Title: TWideStringField
FieldName = 'Title'
Size = 30
end
object ADOQuery1Calc1: TStringField
FieldKind = fkCalculated
FieldName = 'Calc1'
Calculated = True
end
object ADOQuery1Calc2: TFloatField
FieldKind = fkCalculated
FieldName = 'Calc2'
Calculated = True
end
end
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|