Server/Client communication

Server/Client communication

Post by xtcsu » Wed, 09 May 2007 21:12:33


I tried this query on datasnap with no luck, maybe because it's been queried
more than enough, appreciate your input.

D6 Entp.

In an application using datasnap technology, the server is packaging the
data packet in the TDataSetProvider.AfterApplyDatSets as follows:

OwnerData := VarArrayCreate([0, 1], varVariant);
OwnerData[0] := VarArrayOf(['Test', 'Description', True]);
OwnerData[1] := VarArrayOf(['Test1', 'Description', True]);

How can it (client app.) access this bit of message in on
TClientDataSet.AfterApplyUpdates() method?


regards,
 
 
 

Server/Client communication

Post by Farsha » Thu, 10 May 2007 03:22:04

procedure TForm1.ClientDataSet1AfterApplyUpdates(Sender: TObject; var
OwnerData: OleVariant);
begin
Memo1.Lines.Add(OwnerData[0][0]); // Test
Memo1.Lines.Add(OwnerData[0][1]); // Description
Memo1.Lines.Add(OwnerData[1][0]); // Test1
Memo1.Lines.Add(OwnerData[1][1]); // Description
end;

 
 
 

Server/Client communication

Post by xtcsu » Thu, 10 May 2007 18:22:54

Thank you, I missed a part that the TClientDataSet.AfterApplyUpdates should
check for

if OwnerData[0][0] > '' then

if if OwnerData[0][0] does not contain anything it results in AV. How can I
approach this?

regards
 
 
 

Server/Client communication

Post by www.europe » Fri, 11 May 2007 15:36:45


"xtcsuk" <xtcsuk at gmail dot com> skrev i en meddelelse


Hi,

try to use VarIsEmpty or VarIsNull....

if (not VarIsEmpty(OwnerData[0])) and ((not VarIsEmpty(OwnerData[0][0])) and
((OwnerData[0][0]) <> '')) then ...

/Brian