udm1.pas

来自「工廠採購管理系統」· PAS 代码 · 共 101 行

PAS
101
字号
unit udm1;

interface

uses
  SysUtils, Classes, DB, ADODB,Forms,
  Dialogs;

type
  Tdm1 = class(TDataModule)
    nationlity: TADOTable;
    area_class: TADOTable;
    bb: TADOTable;
    development: TADOTable;
    unit_dw: TADOTable;
    payment: TADOTable;
    transport_fs: TADOTable;
    admin: TADOTable;
    ADOConnection1: TADOConnection;
    Dproduct_class: TDataSource;
    Dmaterial_class: TDataSource;
    Dnationlity: TDataSource;
    Darea_class: TDataSource;
    Dbb: TDataSource;
    Ddevelopment: TDataSource;
    Dunit_dw: TDataSource;
    Dpayment: TDataSource;
    Dtransport_fs: TDataSource;
    Dadmin: TDataSource;
    adomaterial: TADOQuery;
    adoproduct: TADOQuery;
    adotransport: TADOQuery;
    adowarehouse: TADOQuery;
    ADOmaterial_class: TADOQuery;
    ADOproduct_class: TADOQuery;
    ADOsmallclass: TADOQuery;
    smallclass: TDataSource;
    Datasupplier: TDataSource;
    Datacustomer: TDataSource;
    ADOsupplier: TADOTable;
    ADOcustomer: TADOTable;
    ADOCommand1: TADOCommand;
    PublicQuery: TADOQuery;
    ADOConnection2: TADOConnection;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  dm1: Tdm1;

implementation
USES UCONST;
{$R *.dfm}

procedure Tdm1.DataModuleCreate(Sender: TObject);
begin
isclose:=false;
adoconnection1.ConnectionString:=connectionstring;
try
   adoconnection1.Open;
except
   showmessage('服务器连接失败,程序终止');
   isclose:=true;
   exit;
end;
if not adomaterial_class.Active then adomaterial_class.Open;
if not adoproduct_class.Active then adoproduct_class.Open;
if not adosmallclass.Active then adosmallclass.Open;
if not adosupplier.Active then adosupplier.Open;
if not adocustomer.Active then adocustomer.Open;
if not area_class.Active then area_class.Open;
if not nationlity.Active then nationlity.Open;
if not bb.Active then bb.Open;
if not payment.Active then payment.Open;
nationlity.TableName:='country_class';
nationlity.Open;
area_class.TableName:='area_class';
area_class.Open;
bb.TableName:='bb_class';
bb.Open;
development.TableName:='department';
development.Open;
unit_dw.TableName:='unit_class';
unit_dw.Open;
payment.TableName:='payment_class';
payment.Open;
transport_fs.TableName:='transport_fs';
transport_fs.Open;





 end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?