计算最大序号

var
  maxbh: string;
begin
  inherited;
  RzDateTimeEdit1.date := now;
  //计算序列号
  ADOQuery1.Close;
  ADOQuery1.Connection := DM.ADOConnection1;
  ADOQuery1.SQL.Clear; ADOQuery1.Parameters.Clear;
  ADOQuery1.SQL.Add('select max(bh) as maxbh from maindb');
  ADOQuery1.Open;
  if ADOQuery1.fieldbyname('maxbh').Value = null then maxbh := '000000001' else maxbh := f_maxinc(uppercase(ADOQuery1.fieldbyname('maxbh').AsString), length(ADOQuery1.fieldbyname('maxbh').AsString));
posted @ 2009-12-10 09:55  bingege  阅读(155)  评论(0编辑  收藏  举报