求教一个vfp中关于locate for的定位问题
各位大侠:
我有一段程序代码如下:
...
sele sele('fsk_head_age')
loca for name_jb=thisform.text1.value and nld=thisform.combo8.value
if eof()
appe blank
repl name_jb with thisform.text1.value
repl nld with thisform.combo8.value
else
...
endi
...
表里符合条件的记录存在时,程序也总是添加新记录。请问,如何解决? VFP
[解决办法]
loca for ALLTRIM(name_jb)=ALLTRIM(thisform.text1.value) and ALLTRIM(nld)=ALLTRIM(thisform.combo8.value)
看看这样行不行!
[解决办法]
select * from 表名 WHERE ALLTRIM(name_jb)=ALLTRIM(thisform.text1.value) and ALLTRIM(nld)=ALLTRIM(thisform.combo8.value) into cursor temp
if _tally>0
insert into 表名 (name_jb,nld) values(ALLTRIM(thisform.text1.value),ALLTRIM(thisform.combo8.value))
endif