删除数据库记录
在当前目录下有一个相片文件夹photo,有一个bmk.dbf,相片文件中的相片名与bmk.dbf中ksh字段同名,如何把bmk.dbf中没有相片的记录行生成一个新的数据表nophoto.dbf
附件.rar
(119.68 KB)
,谢谢帮助解决。
CLOSE DATABASES USE BMK IN 0 ALIAS BMK =ADIR(XP,SYS(5)+SYS(2003)+[\PHOTO\*.JPG]) FOR I=1 TO ALEN(XP,1) SCAN FOR ALLTRIM(KSH)==GETWORDNUM(XP(I,1),1,[.]) DELETE ENDSCAN ENDFOR SELECT * FROM BMK WHERE NOT DELETED() INTO DBF NOPHOTO BROWSE RECALL ALL IN BMK USE IN SELECT([BMK])
lnCount = Adir(lcPic,Sys(5) + Sys(2003) + '\photo\*.jpg','A') If lnCount < 1 Return Endif Create Cursor temp (nm c(20)) For i = 1 To lnCount Insert Into temp (nm) Values (Juststem(lcPic(i,1))) Next Use bmk In 0 Select * From bmk Where bmk.ksh Not in (Select nm From temp) Into Cursor tmp Use In bmk Select tmp Brow遍历不如sql查询来的快