'image'에 해당되는 글 1건

IT/Delphi

mssql 에서의 image필드를 파일로 만들기

MSSQL에 image type 필드에 이미지가 있는 경우 파일로 만드는 방법입니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

var
  qryCust : TMSQuery;
  ms := TMemoryStream;
 begin
  qryCust := TMSQuery.Create(nil);
  qryCust.Connection := DBCONNECTION;
  ms := TMemoryStream.Create;
  try
    with qryCust do
    begin                   
      close;                
      sql.text := ' select imageField from TableName ';
      Open;
      TBlobField( FieldByName('Image')).SaveToStream(  ms );
      ms.Position := 0;
      ms.SaveToFile('C:\123.jpg');
    end;
  finally
    qryCust.Free;
    ms.free;
  end
cs


,

최근 댓글

최근 트랙백

알림

이 블로그는 구글에서 제공한 크롬에 최적화 되어있고, 네이버에서 제공한 나눔글꼴이 적용되어 있습니다.

링크

카운터

Today :
Yesterday :
Total :