C
CHINESEWHOAMI
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大师好!以下一段代码为由电脑产生最新的单据单号,如果不是同时间按一切OK,问题出在两部电脑同时按[保存]按钮时,会出现单据单号一模一样,不知要如何解决?还请各位大师指点下.谢谢! ADOQUERY1.SQL.TEXT:='SELECT TOP 1 SHDH FROM CGSHD_S WHERE (DE_ IS NULL OR DE_='+''''+''+''''+') ORDER BY SHDH DESC'; ADOQUERY1.Open; IF ADOQUERY1.RecordCount=0 THEN EDIT18.TEXT:='YH000001' ELSE EDIT18.TEXT:='YH'+DUPESTRING('0',6-LENGTH(TRIM(INTTOSTR(STRTOINT(COPY(ADOQUERY1.FIELDBYNAME('SHDH').AsString,3,6))+1))))+TRIM(INTTOSTR(STRTOINT(COPY(ADOQUERY1.FIELDBYNAME('SHDH').AsString,3,6))+1)); ADOQUERY1.Close;