只做过BH字段类型为int,而为字符类型
还没想出来!

解决方案 »

  1.   

    {********************************************************}
    {           Written By BlazingFire 2002.9                }
    {  The following function can make a string transfer to  }
    {  a new string which a little bigger than the old one.  }
    {********************************************************}function GetNextStr(OldStr:String):String;
    var
      i:integer;
      ChrOrd:Byte;
    begin
      Result:=' '+Trim(OldStr);
      for i:=Length(Result) DownTo 1 do
      begin
        ChrOrd:=Ord(Result[i]);
        if (ChrOrd in [Ord('a')..Ord('y')]) OR
           (ChrOrd in [Ord('0')..Ord('8')]) OR
           (ChrOrd in [Ord('A')..Ord('Y')]) then
        begin
          Result[i]:=Chr(ChrOrd+1);
          Result:=Trim(Result);
          exit;
        end
        else if Result[i]='z' then
          Result[i]:='a'
        else if Result[i]='Z' then
          Result[i]:='A'
        else if Result[i]='9' then
          Result[i]:='0'
        else
        begin
          Result[i]:='A';
          Result:=Trim(Result);
          exit;
        end;
      end;
    end;
      

  2.   

    在插入记录的时候,查询在表中bh编号最大的,然后在提交前将这个编号加1的编号写入到新插入的记录中当然了,这其中要用到字符与数值转换函数:strtoint
    inttostr
      

  3.   

    类型转换
      strtoint  or inttostr  就Ok了。