Прочитать BlobStream при помощи TADOQuery из базы Access

{codecitation class=»brush: pascal; gutter: false;» width=»600px»}

Оформил: DeeCo

Автор: http://www.swissdelphicenter.ch

function GetBlobStream(Query: TADOQuery): TMemoryStream;

begin

result := TMemoryStream.Create;

// You must connect to AccessDB first.

// See: Query.Connection, TADOConection or Query.ConnectString

// Send SQL command

Query.Active := False;

Query.SQL.Clear;

// data is my row and email the table

Query.SQL.Append(‘SELECT data FROM email WHERE id=1’);

Query.Active := True;

Result.LoadFromStream(Query.CreateBlobStream(Query.FieldByName(‘Data’), bmRead));

end;

{/codecitation}

Добавить комментарий