if savedialog1.Execute  then
   begin
      form1.ADOConnection1.Close;
      form3.ADOConnection1.Close;
      if copyfile(Pchar(savedialog1.filename),pchar(getcurrentdir+'\毕业设计\date\date.mdb'),false) then
      begin
        messagebox(handle,'数据备份成功','提示',mb_ok+mb_iconexclamation);
        form1.ADOConnection1.open;
        form3.ADOConnection1.open;
      end
      else
        messagebox(handle,'数据备份失败','提示',mb_ok+mb_iconexclamation);
        form1.ADOConnection1.open;
        form3.ADOConnection1.open;
   end;
一个按钮中加入这段话,死活不能保存,请高手解决下.交换copyfile里的两个内容也是一样不能保存

解决方案 »

  1.   

    老兄,参数的顺序写错了,应该把: if copyfile(Pchar(savedialog1.filename),pchar(getcurrentdir+'\毕业设计\date\date.mdb'),false) then改为: if copyfile(pchar(getcurrentdir+'\毕业设计\date\date.mdb'),Pchar(savedialog1.filename),false) then
      

  2.   

    还有,你的数据库所在目录和数据库文件名 date 吗?date是日期,一般是用data 吧?
      

  3.   

    哈哈谢谢大家~~我在别的机器上也是可以的就是自己的机器上不行,真晕了,谢谢pilicat