ClientDataset二进制文件保存问题(200分)

  • 主题发起人 主题发起人 dd001
  • 开始时间 开始时间
D

dd001

Unregistered / Unconfirmed
GUEST, unregistred user!
问题描述我已做成avi文件,请用影音风暴播放<br><br>具体代码如下<br>&nbsp;if DlgOpen.Execute then<br>&nbsp; begin<br>&nbsp; &nbsp; if UpdateCDS.State in [dsBrowse] then<br>&nbsp; &nbsp; &nbsp; if UpdateCDS.FieldByName('序号').AsString = '' then<br>&nbsp; &nbsp; &nbsp; &nbsp; UpdateCDS.Append<br>&nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; UpdateCDS.Edit;<br><br>&nbsp; &nbsp; if UpdateCDS.State in [dsinsert, dsedit] then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; UpdateCDS.FieldByName('更新文件名').Asstring := trim(ExtractFileName(DlgOpen.FileName));<br>&nbsp; &nbsp; &nbsp; UpdateCDS.FieldByName('文件日期').AsDateTime := filedatetodatetime(FileAge(DlgOpen.FileName));<br>&nbsp; &nbsp; &nbsp; ClientDatasetBlobtodb(UpdateCDS, DlgOpen.FileName, '文件内容');<br>&nbsp; &nbsp; &nbsp; UpdateCDS.FieldByName('文件大小').AsString:= inttoStr(GetFileSize(DlgOpen.FileName));<br><br>&nbsp; &nbsp; &nbsp; UpdateCDS.Post;<br>&nbsp; &nbsp; &nbsp; UpdateCDS.SaveToFile('c:/save-new.xml',dfXMLUTF8);<br>&nbsp; &nbsp; &nbsp; Memo1.Lines.LoadFromFile('c:/save-new.xml') ;<br><br>&nbsp; &nbsp; &nbsp; Tempcds.Data:=Null;<br>&nbsp; &nbsp; &nbsp; Tempcds.Data := UpdateCDS.Delta;<br>&nbsp; &nbsp; &nbsp; &nbsp;Tempcds.MergeChangeLog ;<br>&nbsp; &nbsp; &nbsp; Tempcds.SaveToFile('c:/start-New1.xml',dfXMLUTF8);<br>&nbsp; &nbsp; &nbsp; Memo2.Lines.LoadFromFile('c:/start-new1.xml') ;<br>&nbsp; &nbsp; end;<br><br>&nbsp; end;<br>发现在 &nbsp; &nbsp;Tempcds.Data := UpdateCDS.Delta;这句后, save-new.xml和start-new1.xml两个文件中的二进制文件内容居然发生了改变.<br>先谢谢各位版主了.<br>如果需要程序demo可以qq联系我 qq:413264451
 
后退
顶部