一个数据库完成保存,类式:Bitmap.SaveToFile('C:\screen.bmp');

解决方案 »

  1.   

    Type
      TMyDatabase = class(TObject)
      private
        ADOConnection: TADOConnection;
        DatabaseName: String;
      public
        procecure SaveToFile(lpFilcName: String);
      end;procedure TMyDatabase.SaveToFile(lpFileName: String);
    var
      ADOCommand: TADOCommand;
    begin
      ADOCommand:= TADOCommand.Create(Self);
      ADOCommand.Connection:= ADOConnection;
      ADOCommand.CommandType:= cmdText;
      ADOCommand.CommandText:= 'backup database ' + DatabaseName + ' to disk=''' + lpFileName + ''' with INIT';
      ADOCommand.Prepared:= true;
      ADOCommand.Execute;  
    end;嘿嘿,随便写写,核心就是这样。
    其它诸如构造函数、析构函数什么的就请楼主自己写一下吧。
      

  2.   

    看个大概。我想了一个笨办法。table不是post可以保存吗。 我做了一个temp文件, 当用忘户要保存时我就用文件类。用户要保存在哪里我就将其拷贝到哪里。你说好不好。        table1.Close;
            find_table.Close;
            oldfile:= tfilestream.Create(opendialog1.FileName, fmopenread);
            newfile:= tfilestream.Create(FileDir, fmCreate);
            newfile.CopyFrom(oldfile, oldfile.Size);
            freeandnil(oldfile);            //释放内存
            freeandnil(newfile);
    这样好不好。