1 DBF表中的字段名不可能以数字开头
2 表2中的字段名没有修改的必要
3 在需要的时候再修改字段名的显示
CREATE CURSOR T1 (cjxdm c(10), cjxmc c(10))
INSERT INTO T1 VALUES ("Gk01","语文")
INSERT INTO T1 VALUES ("Gk02","数学")
INSERT INTO T1 VALUES ("Gk03","英语")
CREATE CURSOR T2 (xh c(10), Gk01 n(3), Gk02 n(3), Gk03 n(3))
INSERT INTO T2 VALUES ("10011",85 , 90, 77)
INSERT INTO T2 VALUES ("10058",99 , 70, 73)
INSERT INTO T2 VALUES ("10069",55 , 43, 88)
SELECT T1
cStr = "xh"
SCAN
cStr = cStr + "," + cjxdm + " AS " + cjxmc
ENDSCAN
SELECT &cStr FROM T2
2 表2中的字段名没有修改的必要
3 在需要的时候再修改字段名的显示
CREATE CURSOR T1 (cjxdm c(10), cjxmc c(10))
INSERT INTO T1 VALUES ("Gk01","语文")
INSERT INTO T1 VALUES ("Gk02","数学")
INSERT INTO T1 VALUES ("Gk03","英语")
CREATE CURSOR T2 (xh c(10), Gk01 n(3), Gk02 n(3), Gk03 n(3))
INSERT INTO T2 VALUES ("10011",85 , 90, 77)
INSERT INTO T2 VALUES ("10058",99 , 70, 73)
INSERT INTO T2 VALUES ("10069",55 , 43, 88)
SELECT T1
cStr = "xh"
SCAN
cStr = cStr + "," + cjxdm + " AS " + cjxmc
ENDSCAN
SELECT &cStr FROM T2
[此贴子已经被作者于2019-6-4 13:03编辑过]
坚守VFP最后的阵地