Распределенные вычисления и технологии Inprise

unit del1;
//Another simple MTS server
//By N.Elmanova
//01.12.1998


interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComServ, ComObj, VCLCom, StdVcl, BdeProv, BdeMts, DataBkr, DBClient,
  MtsRdm, Mtx, dels_TLB, DBTables, Provider, Db;

type
  TdelDM = class(TMtsDataModule, IdelDM)
    deltable: TTable;
    DelProvider: TProvider;
    Database2: TDatabase;
    Query4: TQuery;
    Session2: TSession;
  private
    { Private declarations }
  public
    { Public declarations }
  protected
    function GetDelivery: OleVariant; safecall;
    procedure AddDelivery(OrdNum: Integer; const  OrdName: WideString; const OrdAddr: WideString);
      safecall;
    procedure DelDelivery(OrdNum: Integer); safecall;
  end;

var
  delDM: TdelDM;

implementation

{$R *.DFM}

function TdelDM.GetDelivery: OleVariant;
begin
Result:=DelProvider.Data;
SetComplete;
end;

procedure TdelDM.AddDelivery(OrdNum: Integer; 
const OrdName: WideString; const  OrdAddr: WideString);
begin
try
    deltable.open;
    deltable.append;
    deltable.fieldbyname('OrdNum').Value:=OrdNum;
    deltable.fieldbyname('GoodsName').Value:=OrdName;
    deltable.fieldbyname('Address').Value:=OrdAddr;
    deltable.post;
    deltable.close;
    SetComplete;
except
   SetAbort;
raise;
end;
end;

procedure TdelDM.DelDelivery(OrdNum: Integer);
begin
try
   Query4.Params[0].Value:=OrdNum;
   Query4.Prepare;
   Query4.ExecSQL;
SetComplete;
except
   SetAbort;
raise;
end;

end;

initialization
  TComponentFactory.Create(ComServer, TdelDM,
    Class_delDM, ciMultiInstance, tmApartment);
end.

возврат


Наш канал на Youtube

1999 1 2 3 4 5 6 7 8 9 10 11 12
2000 1 2 3 4 5 6 7 8 9 10 11 12
2001 1 2 3 4 5 6 7 8 9 10 11 12
2002 1 2 3 4 5 6 7 8 9 10 11 12
2003 1 2 3 4 5 6 7 8 9 10 11 12
2004 1 2 3 4 5 6 7 8 9 10 11 12
2005 1 2 3 4 5 6 7 8 9 10 11 12
2006 1 2 3 4 5 6 7 8 9 10 11 12
2007 1 2 3 4 5 6 7 8 9 10 11 12
2008 1 2 3 4 5 6 7 8 9 10 11 12
2009 1 2 3 4 5 6 7 8 9 10 11 12
2010 1 2 3 4 5 6 7 8 9 10 11 12
2011 1 2 3 4 5 6 7 8 9 10 11 12
2012 1 2 3 4 5 6 7 8 9 10 11 12
2013 1 2 3 4 5 6 7 8 9 10 11 12
Популярные статьи
КомпьютерПресс использует