两位版主,帮帮。
select * from 药品 where 药品代码 like alltrim(thisform.text1.value)+'%' into cursor 临时药品表 thisform.grid1.recordsource ='临时药品表' *-----后加的 =STRTOFILE([],[CXJG.TXT]) SELECT 药品代码,药品名称,规格 FROM 药品 WHERE UPPER(LEFT(药品代码,1))== UPPER(ALLTRIM(THIS.VALUE)) TO FILE CXJG.TXT NOCONSOLE THISFORM.EDIT1.VALUE=IIF(EMPTY(FILETOSTR([CXJG.TXT])),[没有符合条件的记录],FILETOSTR([CXJG.TXT])) THISFORM.REFRESH
SELECT top 1 药品代码,药品名称,规格 FROM 药品 WHERE alltrim(thisform.text1.value)$药品代码 order by 1 TO FILE CXJG.TXT NOCONSOLE THISFORM.EDIT1.VALUE=IIF(EMPTY(FILETOSTR([CXJG.TXT])),[没有符合条件的记录],FILETOSTR([CXJG.TXT])) THISFORM.REFRESH