主题:这个dbf的字段名是“A、B、C、D、E、F、G”,我想将第一行记录变成字段名,请问用什么命令?
李静静
[专家分:0] 发布于 2012-02-23 23:14:00
这个dbf的字段名是“A、B、C、D、E、F、G”,我想将第一行记录变成字段名,请问用什么命令?
回复列表 (共4个回复)
沙发
lygcw9603 [专家分:250] 发布于 2012-02-23 23:45:00
USE 111
GO 1
AA=A
BB=B
CC=C
DD=D
EE=E
FF=F
GG=G
SELECT A AS &AA,B AS &BB,C AS &CC,D AS &DD,E AS &EE,F AS &FF,G AS &GG FROM 111 INTO DBF A111
楼上的朋友会说“谢谢”?
板凳
qjbzjp [专家分:8830] 发布于 2012-02-24 12:26:00
3 楼
qjbzjp [专家分:8830] 发布于 2012-02-24 13:56:00
如果是将表的字段名按第一条记录内容来修改:
USE "c:\documents and settings\qjb\桌面\111"
FOR iii = 1 to FCOUNT()
oldfield=fields(iii)
newfield=&oldfield
ALTER TABLE "c:\documents and settings\qjb\桌面\111" rename column &oldfield to &newfield
NEXT
4 楼
lygcw9603 [专家分:250] 发布于 2012-02-24 14:44:00
[em28]
我来回复