BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Field Value Required on TclientDataset

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress)
View previous topic :: View next topic  
Author Message
Sébastien Beaulieu
Guest





PostPosted: Wed Feb 23, 2005 9:59 pm    Post subject: Field Value Required on TclientDataset Reply with quote



Hi,

My problem is, Field or all Required and that ok, I want to create a memory
dataset with a TclientDataset.

I try to Load data from a ClientDataset(Self) to a other
ClientDataset(SourceDataset)

One of the SourceDataset.field[???].value = '
' in the from dataset
and when a assigned it to the other Clientdataset self.Field[???].value =
'';



Did I have a way to set Self.Field[???].value = '
'; ?



procedure TFrwMemDset.LoadFromTDataset(SourceDataset: TDataset);
var
i : integer;
FieldNames : String;
begin

SourceDataset.FieldList.Delimiter := ';';
Self.FieldList.Delimiter := ';';

Assert(Self.FieldList.DelimitedText =
SourceDataset.FieldList.DelimitedText,
'Can''t TFrwMemDset.LoadFromTDataset when Field on different '
+#13#10 +
'Dataset 1 = ' + Self.FieldList.DelimitedText + #13#10 +
'Dataset 2 = ' + SourceDataset.FieldList.DelimitedText);

FieldNames := SourceDataset.FieldList.DelimitedText;

SourceDataset.First;
while not SourceDataset.Eof do begin
Append;

self[FieldNames] := SourceDataset[FieldNames];
// Testing
// for i := 0 to Self.FieldCount -1 do
// self.Fields[i].Value :=
SourceDataset.Fieldbyname(Self.Fields[i].fieldname).Value;
Post;
SourceDataset.Next;
end;

Regard
SB


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.