我设计的自动编号但是运行时,出现DBedit11,field'sczj'找不到,我把DBedit11
删了以后,又出现Dbedit10 'field' 找不到;。。
  请各位高手解释一下:谢谢! 这是自动编号代码:
  DateTimeToString(result,'yy',now());
  year1:=strtoint(result);
  No:=result;   // Äꣻ  DateTimeToString(result,'mm',now());
  month1:=strtoint(result);
  if month1>10 then
  no:=no+inttostr(month1);
  if month1<10 then
  no:=no+'0'+inttostr(month1);//&Ocirc;&Acirc;  DateTimeToString(result,'dd',now());
  Day1:=strtoint(result);;
  if Day1>=10 then
  no:=no+inttostr(day1);
  if Day1<10  then
  no:=no+'0'+inttostr(day1);   //&Igrave;ì
  adoquery1.Close ;
  adoquery1.SQL.Clear ;
  adoquery1.SQL.Add('select max(dh) from khda');
  adoquery1.Open ;
   
  if adoquery1.fields[1].AsString<>'' then
  begin
    s:=copy(adoquery1.fields[1].AsString,11,3);
    q:=strtoint(s)+1;
    i:=2-length(inttostr(q));
    s:=inttostr(q);
    for j:=1 to i do
    begin
      s:='0'+s;
    end;
    adoquery1.FieldByName('dh').AsString :=no+'_'+s;
  end
  else
  begin
    adoquery1.FieldByName('dh').AsString :=no+'_'+'001';
  end;
end;