在ACCESS里用OLE的格式存了几张BMP的图片,我想试着编一个输入编号查询的程序,但图片始终没出现,郁闷啊。都好几天了,而且JPEG格式的了插不进去。下面是源代码,请各位高手们帮忙给看看,谢谢
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DBCtrls, DB, ADODB,jpeg, ExtCtrls;type
  TForm1 = class(TForm)
    ADOQuery1: TADOQuery;
    Button1: TButton;
    Edit1: TEdit;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
jpeg:tjpegimage ;
bitmap:tbitmap;
mstream:tmemorystream;
begin
      with   adoquery1   do
          begin
            sql.clear;
            sql.add('select   *   from   表1  where     ID=:ID');
            parameters.ParamByName('ID').Value   :=edit1.Text   ;
            open;
            image1.Picture :=nil;
  if   adoquery1.FieldByName('属性').Value   =1   then
  begin
  mstream:=tmemorystream.Create;
   bitmap:=tbitmap.create
   //   (该员工的图片为)bitmap
   Tblobfield(adoquery1.FieldByName('图片')).SaveToStream(mstream);// 提示我这里错了,这是为什么呢。
     mstream.Position:=0;
       bitmap.LoadFromStream(mstream);
       image1.Picture.Assign(bitmap);
      end
          else    if  adoquery1.FieldByName('属性').Value   =0     //jpge;
                    then
                        begin
                              mstream:=tmemorystream.Create;
                              jpeg:=tjpegimage.Create   ;
                              try
                              Tblobfield(adoquery1.FieldByName('图片')).SaveToStream(mstream);
                               mstream.Position:=0;
                              jpeg.LoadFromStream(mstream);
                               image1.Picture.Assign(jpeg);
                              finally   
                              jpeg.Free   ;
                              bitmap.Free;
                              end;   
                        end;
                    close;
          end;
          end;
end.这是报的错:看不懂呢,我感觉应该没什么错啊,
Build
  [Error] Unit1.pas(47): Missing operator or semicolon
  [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

解决方案 »

  1.   

      bitmap:=tbitmap.create               // 这里没有; 是你少写还是忘记写?
      //  (该员工的图片为)bitmap 
      

  2.   

    bitmap:=tbitmap.create;//少了个分号
      //  (该员工的图片为)bitmap
      Tblobfield(adoquery1.FieldByName('图片')).SaveToStream(mstream);/
      

  3.   

    照各位先生的说话改正之后,能运行但是出现‘Bitmap image is not valid’的错误提示,楼上那位兄台给出的方法看不明白呢。我再网上也找了一些资料,说得都不清楚。各位还有招没,