程序代码:
CLOSE DATABASES all
USE kb20190101 ALIAS kb IN 0
COPY STRUCTURE TO xb FIELDS nj,bj,()
USE xb ALIAS xb IN 0
USE jsrkb20190101 ALIAS js IN 0
USE jsmd20180912 ALIAS jsmd IN 0
SELECT kb
GO top
SCAN FOR NOT EOF()
SELECT js
GO top
LOCATE FOR nj==kb.nj AND bj==kb.bj
IF FOUND()
aa=()
aa=kb.&aa
aa=js.&aa
INSERT INTO xb (nj,bj,()) VALUES (js.nj,js.bj,aa)
ENDIF
SELECT kb
ENDSCAN
IF thisform.optiongroup1.Value=1
SELECT xb
BROWSE
ELSE
SELECT jsmd
COPY STRUCTURE TO xb1
USE xb1 ALIAS xb1 IN 0
SELECT jsmd
GO top
SCAN FOR NOT EOF()
SELECT xb
GO top
LOCATE FOR ALLTRIM(&comb1)==ALLTRIM(jsmd.姓名)
IF !FOUND()
INSERT INTO xb1 (序号,姓名) VALUES (jsmd.序号,jsmd.姓名)
ENDIF
SELECT jsmd
ENDSCAN
SELECT xb1
BROWSE
ENDIF