我做了一个软件是关于仓库帐簿管理的他里面有个先进先出的功能用sql怎么做到?!~~

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, Grids, DBGrids, DB, ADODB, StdCtrls, DBCtrls, ComCtrls,
      TFlatProgressBarUnit;type
      TForm1 = class(TForm)
        ADOConnection1: TADOConnection;
        ADOQuery1: TADOQuery;
        Button1: TButton;
        DataSource1: TDataSource;
        DBGrid1: TDBGrid;
        Label1: TLabel;
        Label2: TLabel;
        FlatProgressBar1: TFlatProgressBar;
        procedure Button1Click(Sender: TObject);
        procedure ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress,
          MaxProgress: Integer; var EventStatus: TEventStatus);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      ADOQuery1.Close;
      ADOQuery1.SQL.Clear;
      ADOQuery1.SQL.Add('select * from MainTable');
      ADOQuery1.Open;
    end;procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet;
      Progress, MaxProgress: Integer; var EventStatus: TEventStatus);
    begin
      FlatProgressBar1.Position := Progress*100 div maxProgress;
      label1.Caption := IntToStr(Progress);
      label2.Caption := IntToStr(maxProgress);
      Application.ProcessMessages;
    end;end.