datamod.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit datamod;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, HTTPApp, WebModu, DBXpress, FMTBcd,
  5.   DB, SqlExpr, Provider, DBClient, DBLocal, DBLocalS, WebAdapt, DBAdapt,
  6.   WebComp;
  7. type
  8.   TWDataMod = class(TWebDataModule)
  9.     ibConnection: TSQLConnection;
  10.     dsDepartment: TDataSource;
  11.     cdsDepartment: TSQLClientDataSet;
  12.     cdsEmployee: TSQLClientDataSet;
  13.     dsaDepartment: TDataSetAdapter;
  14.     AdaptDEPARTMENT: TDataSetAdapterField;
  15.     AdaptDEPT_NO2: TDataSetAdapterField;
  16.     AdaptHEAD_DEPT: TDataSetAdapterField;
  17.     AdaptLOCATION: TDataSetAdapterField;
  18.     AdaptBUDGET: TDataSetAdapterField;
  19.     dsaEmployee: TDataSetAdapter;
  20.     AdaptEMP_NO: TDataSetAdapterField;
  21.     AdaptFIRST_NAME: TDataSetAdapterField;
  22.     AdaptLAST_NAME: TDataSetAdapterField;
  23.     AdaptDEPT_NO: TDataSetAdapterField;
  24.     AdaptJOB_CODE: TDataSetAdapterField;
  25.     AdaptJOB_COUNTRY: TDataSetAdapterField;
  26.     AdaptSALARY: TDataSetAdapterField;
  27.   private
  28.     { Private declarations }
  29.   public
  30.     { Public declarations }
  31.   end;
  32.   function WDataMod: TWDataMod;
  33. implementation
  34. {$R *.dfm} 
  35. uses WebReq, WebCntxt, WebFact, Variants;
  36. function WDataMod: TWDataMod;
  37. begin
  38.   Result := TWDataMod(WebContext.FindModuleClass(TWDataMod));
  39. end;
  40. initialization
  41.   if WebRequestHandler <> nil then
  42.     WebRequestHandler.AddWebModuleFactory(TWebDataModuleFactory.Create(TWDataMod, crAlways, caCache));
  43. end.