unit Umasterslavetab; interface uses //定义工程中使用的单元文件 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Db, Grids, DBGrids, DBTables, ExtCtrls, DBCtrls, StdCtrls; type TForm1 = class(TForm) //定义显示窗体 DinghuoTable: TTable; //订货表 KhuTable: TTable; //客户表 DinhuoChuliTable: TTable; //订货细目表 KehuDBGrid: TDBGrid; //显示客户信息数据网格 DinhuoChuliDBGrid: TDBGrid; //显示订货细目数据网格 DinghuoDBGrid: TDBGrid; //显示订货数据网格 KehuDataSource: TDataSource; //客户数据源 DinhuoChuliDataSource: TDataSource; DinghuoDataSource: TDataSource; //订货数据源 //定义在窗体上使用的标签 Label1: TLabel; Label8: TLabel; Label9: TLabel; GongsikehuL: TLabel; //如下是显示时使用的内部字段名 //说明:在显示表的内容时,使用内部定义的字段名,通常它是Table组件的 //Name属性名+字段名,但当表中字段为汉字名时,内部字段名为Name //属性名+BDEDesigner+序号} KhuTableBDEDesigner: TSmallintField; KhuTableBDEDesigner2: TStringField; KhuTableBDEDesigner3: TStringField; KhuTableBDEDesigner4: TStringField; KhuTableBDEDesigner5: TStringField; KhuTableBDEDesigner6: TStringField; DinghuoTableBDEDesigner: TIntegerField; DinghuoTableBDEDesigner2: TIntegerField; DinghuoTableBDEDesigner3: TCurrencyField; DinghuoTableBDEDesigner4: TSmallintField; DinghuoTableBDEDesigner6: TSmallintField; DinghuoTableBDEDesigner7: TStringField; DinhuoChuliTableBDEDesigner6: TCurrencyField; DinhuoChuliTableBDEDesigner: TIntegerField; DinhuoChuliTableBDEDesigner2: TSmallintField; DinhuoChuliTableBDEDesigner3: TSmallintField; DinhuoChuliTableBDEDesigner4: TDateField; DinhuoChuliTableBDEDesigner5: TDateField; DinhuoChuliTableBDEDesigner7: TDateField; Bevel1: TBevel; //画线 private { Private declarations } public { Public declarations } end; var Form1: TForm1; //窗体说明 implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); //在应用建立时,调用该过程,重新关闭和打开相关的数据库表 begin KehuTable.close; KehuTable.open; //打开客户表 DinhuoChuliTable.close; DinhuoChuliTable.open; //打开订货细目表 DinghuoTable.close; DinghuoTable.open; //打开订货表 End; end.
多级控制的主从表查询
最新推荐文章于 2021-02-18 00:26:58 发布