Table1 ---------------- 用来记录数据区的值
Field1: Int;Table2 ---------------- 就是你要的客户编号所在的表
Field1: Char(5)function GetCustomerID: String;
begin
Table1.Field1.Value := Table1.Field1.Value + 1;
Result := 'AB' + IntToStr(Table1.Field1.Value);
end;
try
DataBase.StartTransaction;
Table2.Field1 := GetCustomerID;
DataBase.Commit;
except
DataBase.RollBack;
end;//至于剩下的问题:
1、数值区是否一要到xxx的形式,另加代码
2、注意并发控制
[注]:对于作出的回复不作正确性保证
Copyright(C) 2002 CoolSlob :-)
Field1: Int;Table2 ---------------- 就是你要的客户编号所在的表
Field1: Char(5)function GetCustomerID: String;
begin
Table1.Field1.Value := Table1.Field1.Value + 1;
Result := 'AB' + IntToStr(Table1.Field1.Value);
end;
try
DataBase.StartTransaction;
Table2.Field1 := GetCustomerID;
DataBase.Commit;
except
DataBase.RollBack;
end;//至于剩下的问题:
1、数值区是否一要到xxx的形式,另加代码
2、注意并发控制
[注]:对于作出的回复不作正确性保证
Copyright(C) 2002 CoolSlob :-)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货