1.存储jpg或bmp图片的代码如何写?
2.编辑记录时,如何显示该记录中的各项(关键是图像字段)?
3.如何备份该数据库(拷贝mdb文件的代码如何写)?谢谢各位热情关注~:)

解决方案 »

  1.   

    字段用ole对象类型
    用ADOBlobStream对象读写,看看Delphi Help就很容易了,和TFileStream差不多,我就不废话了
      

  2.   

    第三个:用Windows API : CopyFile
      

  3.   

    tbolbfield(query1.fieldbyname('fieldneme')).loadfromfile('filename')tbolbfield(query1.fieldbyname('fieldneme')).loadfromstream('streamname')
      

  4.   

    谢谢,第三个问题已经解决~~
    不过前两个问题还没有,lesstif,dainellee二位能否把代码写的详细一点
    感谢不尽~
    问题解决后立马结帖!
      

  5.   

    var
       Picture:TPicture;
       BMP:TBitmap;
       jpg:TJPEGImage;
       Stream:TMemoryStream;
      begin
       if openpicturedialog1.Execute then
        begin
          Picture:=TPicture.Create;
          Picture.LoadFromFile(OpenPictureDialog1.FileName);
          image1.Picture.Assign(Picture);
           begin
             if Picture.Graphic is TBitmap then
                dbimage1.Picture:=image1.Picture
             else if Picture.Graphic is TJPEGImage then
                begin
                  Stream:=TMemoryStream.create;
                  Jpg:=TJpegImage.create;
                  Bmp:=TBitmap.create;
                  try
                   Stream.loadfromFile(OpenPictureDialog1.FileName);
                    Stream.seek(0,0);
                    Jpg.loadFromStream(Stream);
                    Bmp.Assign(Jpg);
                   Image1.Picture.Bitmap.Assign(Bmp);
                   dbimage1.Picture:=image1.Picture;
                  finally
                    Stream.free;
                    Bmp.free;
                    Jpg.free;
                  end;
                end;
           end;
            Picture.Free;
        end;
    end;