全部博文(788)
分类:
2008-11-18 14:50:22
procedure TFormDemo.ButtonWriteClick(Sender: TObject);
begin
AdoQuery.SQL.Text := 'Insert B(TextFile) Values(:TextFile)';
AdoQuery.Parameters.ParamByName('TextFile').LoadFromFile('C:\odbcconf.log', ftMemo);
AdoQuery.ExecSQL;
end;
procedure TFormDemo.ButtonReadClick(Sender: TObject);
begin
AdoQuery.SQL.Text := 'Select TextFile From B';
AdoQuery.Open;
TMemoField(AdoQuery.FieldByName('TextFile')).SaveToFile('C:\TEST.TXT');
Memo.Lines.LoadFromFile('C:\TEST.TXT');
end;
把字段变为Memo类型,Delphi的回车标识是: #13#10
如存储时 FieldByName('Memo').AsString := Memo1.text + #13#10;