读书人

十豆三老师。COPY TO 中路径的有关问

发布时间: 2012-03-07 09:13:51 作者: rapoo

十豆三老师。COPY TO 中路径的问题
想有COPY TO 将当前数据表备份到相关的目录下。COPY TO 后面的的路径应该用变量吗,或者宏替换。我试了一下怎么都提示错误。能给个示例吗?

[解决办法]
1. 直接备份数据表中的内容

使用copy to

lcPath = "c:\program files\tt.dbf"

copy to (lcPath)

copy to "c:\program files\tt.dbf"

2. 备份表文件

使用copy file 命令

aa.dbf 为要备份的文件

copy file aa.dbf to "c:\program files\tt.dbf"

or

copy file aa.dbf to (lcPath)

总起来说

可以使用变量

也可以使用宏

当路径中带有空格的时候

变量名要加小括号或是引号
[解决办法]
lcPath = "c:\program files\tt.dbf"

copy to (lcPath)

copy to '&lcPath.'

copy to 'c:\program files\tt.dbf'

读书人网 >VFP

热点推荐