一个数据库完成保存 一个数据库完成保存,类式:Bitmap.SaveToFile('C:\screen.bmp'); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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;嘿嘿,随便写写,核心就是这样。其它诸如构造函数、析构函数什么的就请楼主自己写一下吧。 看个大概。我想了一个笨办法。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);这样好不好。 cxGrid 如何判断单元格为空值 高手快来......紧急求助中:数据库修改后,数据敏感控件的刷新问题 所谓三层结构是不是被吹大了呢? dbExpress中SQLDataSet的SchemaName属性是什么意思,怎么用阿,帮助查不到 最后的三分二号,仍然是先到先得。 一个不可失意的兼容问题(在线等侯) 如何获得服务器的时间? 怎样编程实现对access数据库文件的加密??? 一dbgrid的字段显示的问题! delphi7怎么存取sql2000中text类型的值 [诚求动作-Delphi]怎么样获取鼠标在ListView上点击后的坐标!?? 备份
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;嘿嘿,随便写写,核心就是这样。
其它诸如构造函数、析构函数什么的就请楼主自己写一下吧。
find_table.Close;
oldfile:= tfilestream.Create(opendialog1.FileName, fmopenread);
newfile:= tfilestream.Create(FileDir, fmCreate);
newfile.CopyFrom(oldfile, oldfile.Size);
freeandnil(oldfile); //释放内存
freeandnil(newfile);
这样好不好。