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 

how can server show message

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier)
View previous topic :: View next topic  
Author Message
Ali Ade
Guest





PostPosted: Wed Nov 10, 2004 8:04 am    Post subject: how can server show message Reply with quote



in multitier using delphi 8 ,the problem is when the client post values in
database on the server check validate of these values i want to know which
event i must use on the server to check , is it onupdated for dbadaptor ?
second if the server need to show message at the client how can this done?
and some times the server need to show message at the client and wait for
response to determine what will done.pls help ,thanks.


Back to top
Hifni
Guest





PostPosted: Thu Dec 02, 2004 5:19 am    Post subject: Re: how can server show message Reply with quote




"Ali Ade"
<mohamad_adel_2000 (AT) hotmail (DOT) com> wrote:
Quote:
in multitier using delphi 8 ,the problem is when the client post values in database on the server check validate of these values i want to know which
event i must use on the server to check , is it onupdated for dbadaptor ?


I use the DataSetProvider.BeforeUpdate Event to Validate, process, check Data etc. It's a great place to do that kind of stuffs.

Quote:
second if the server need to show message at the client how can this done?
I think You cant Show Message to the Client, but could send any error message after Validation, etc as:

Raise Exception.Create(<----Type Your Message Here---->);


For Example:
Here I'm Validating the StartMeter and EndMeter Value, and if it didn't come across the said validation, the server will send an Error Message:

procedure TAppServerFuelMax.dspFuelIssueEntryBeforeUpdateRecord(
Sender: TObject; SourceDS: TDataSet; DeltaDS: TClientDataSet;
UpdateKind: TUpdateKind; var Applied: Boolean);
begin
if UpdateKind in [ukInsert,ukmodify] then
begin
With DeltaDS do
begin
//1st Business Logic: Check whether the Endmeter is Larger than the StartMeter.........................
if (FieldByName('IsVehicle').NewValue = True) then
if (FieldByName('StartMeter').NewValue) >= (FieldByName('EndMeter').NewValue)then
Raise Exception.Create('Entries Could Not Have Higher StartMeter Value than EndMeter Value');
end;
end;

Hope You might have got the idea now.

Rgds,
Hifni




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier) 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.