我用以下代码不行:提示找不到别名zxlb
CLOSE ALL
USE bm
SELECT DISTINCT zxmc FROM bm INTO cursor zxlb
sele zxlb
sss=reccount()
GO top
i=1
DO WHILE i<sss AND NOT EOF()
lcdqzx=ALLTRIM(zxlb.zxmc )
SELECT bm
COUNT FOR ALLTRIM(bm.zxmc)==lcdqzx TO zxrs
IF zxrs>300
SELECT *
FROM bm WHERE
ALLTRIM(bm.zxmc)==lcdqzx INTO TABLE dbmk
USE dbmk
LOCATE FOR recno()=300
SELECT dbmk.* FROM dbmk WHERE recno()<=300 INTO TABLE
bmksy1
SELECT dbmk.* FROM dbmk WHERE recno()>300
INTO TABLE bmksy2
CLOSE DATABASES
USE bmksy1
REPLACE ALL bmksy1.zxmc WITH ALLTRIM(lcdqzx+'(一)')
USE bmksy2
REPLACE ALL bmksy2.zxmc WITH ALLTRIM(lcdqzx+'(二)')
CLOSE DATABASES
USE dbmk
DELETE ALL
PACK
APPEND FROM bmksy1
APPEND FROM bmksy2
SELECT * FROM dbmk ORDER by zxmc INTO TABLE bmsj
ENDIF
sele zxlb
&&这里提示找不到别名zxlb
SKIP
i=i+1
ENDDO
CLOSE DATABASES
= Messagebox('已完成初始数据!' ,48,"提示")
[此贴子已经被作者于2017-3-18 12:25编辑过]