当前位置: 代码迷 >> VFP >> 十豆三老师。COPY TO 中路径的有关问题
  详细解决方案

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

热度:8890   发布时间:2013-02-26 00:00:00.0
十豆三老师。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'
  相关解决方案