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));