when processing the BeforeApplyUpdates event on the server in a few cases I
need some additional data from the client (in my case a file).
How do I call the client and ask him to send me the data ?
Or: how do I start a communication between server and client from the server
side ?
I am using TSocketConnections, ciMultiInstance, tmApartment.
Thank you
Andreas Oberhofer
"Andreas Oberhofer" <Andreas....@tin.it> wrote in message
news:3a1e6228$1_1@dnews...
I have already seen this example.
It installs an additional (communication-) server at the client side.
Do I have to install also the ScktSrv.exe on the client ?
Is there no easier way to have the same result, like calling a method of the
TClientDataset or the TSocketConnection ?
If not I think it would be easier to pack some status information into the
AfterApplyUpdates event. My problem is that I would like to call the client
immediatly when processing every single record in the BeforeUpdateRecord
event. When I use AfterApplyUpdates I have to identify the single records I
want to talk about.
It seems that it is not possible with standard Midas methods to communicate
on a record per record level.
Thank you
Andreas
No.
> It seems that it is not possible with standard Midas methods to communicate
> on a record per record level.
It is not.
The callback solution is the best and only available. You just have, from the
server, to call methods of the callback object you created client-side to have
direct communication with the client. The requirements are to use
TSocketConnection client side and use the structure given in the callback
example. Nothing more.
Alexandre Guillien
I store some state information in my client and pass this information as
parameters to the server on apply updates (Thanks to Dan).
Client side:
if dm.paymast.ChangeCount > 0 then
begin
dm.paymast.setoptionalparam('UserLevel', dm.level, True); // thise are
the optional parameters
dm.paymast.setoptionalparam('location', dm.location, True);
if dm.paymast.applyupdates(0) = 0 then
dm.paymast.refresh;
end
else
messagedlg('No changes to save !!!',mtinformation,[mbok],0);
On the server:
beforeupdaterecored event:
var
UserLevel,location: string;
begin
// get the parameters from the client
UserLevel := DeltaDS.GetOptionalParam('UserLevel');
location := DeltaDS.GetOptionalParam('location');
// check for access permissions
if (UpdateKind = ukModify) then
begin
if ((UserLevel <> 'A') and (location <> 'C')) then
raise exception.create('You dont have enough rights to modify data');
end;
end;
A bit extreme to send info to the server and then raise the error but it
works.
--
Sunil Furtado
New Mangalore Port Trust