select 0
use 1
select 0
use jsj1
go top
do while not eof()
select 1
locate for zkzh =jsj1.zkzh
if found()=.t.
replace jsj1.cj with 1.cj
endif
select jsj1
skip
enddo
use jsj1
use 1
replace all jsj1.cj with 1.cj for jsj1.zkzh=1.zkzh
上述代码仅打开了1,而jsj1数据库已经被关闭,所以你的第三行代码肯定会出错,你可能试试下列代码:
sele a
use 1
sele b
use jsj1
replace all cj with a->cj for zkzh=a->zkzh