MainData.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit MainData;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Db, DBTables, IBQuery, IBCustomDataSet, IBTable, IBDatabase;
- type
- TDmMain = class(TDataModule)
- IBDatabase1: TIBDatabase;
- QueryId: TIBQuery;
- IBTransaction2: TIBTransaction;
- public
- function GetNewId: Integer;
- end;
- var
- DmMain: TDmMain;
- implementation
- {$R *.DFM}
- function TDmMain.GetNewId: Integer;
- begin
- // return the next value of the generator
- QueryId.Open;
- try
- Result := QueryId.Fields[0].AsInteger;
- finally
- QueryId.Close;
- end;
- end;
- end.