unit Minglu; {该工程使用查询组件和网格组件,显示公司的人员名录} interface uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, DBTables, ExtCtrls, DBCtrls, StdCtrls; type TForm1 = class(TForm) GongSiQuery: TQuery; {显示名录的查询组件} GongSiSource: TDataSource; GongSiDBGrid: TDBGrid; {显示名录的网格组件} DBNavigator1: TDBNavigator; {显示名录的数据导航组件} GongSiL: TLabel; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin {以下说明建立窗体时所完成的工作} GongSiquery.close; {关闭当前查询} GongSiquery.sql.clear; {清除原查询语句} {在程序执行时,生成SQL语句,它从RenYuan表中获取有关信息} GongSiquery.sql.add('select 人员代号,姓名,部门,职务,出生年月,录用日期 From RenYuan;'); GongSiquery.open; {获取查询结果} end; end.
应用动态SQL语句
最新推荐文章于 2023-09-13 09:06:26 发布