CSDN博客

img 303

上传文件到MSSQL数据库

发表于2004/10/7 20:05:00  727人阅读

var
  query :TADOQuery;
  stream :TMemorystream;
begin
  query:=TADOQuery.Create(nil);
  query.Close();
  query.SQL.Add('SELECT  * FROM a');
  query.Open();
  if (query.RecordCount>0) then begin
      query.Edit();
      stream:=TmemoryStream.Create();
      stream.LoadFromFile(FilePath);
      TBlobField(query.FieldByName('pPhoto')).LoadFromStream(stream);
      FreeAndNil(stream);
      query.Post();
  end;
  query.Close();
  FreeAndNil(query);
阅读全文
0 0

相关文章推荐

img
取 消
img