SQL SERVER似乎是可以的。
其他的怎么办?
要是这个表到了海量,DELPHI却是怎么个解决呢?

解决方案 »

  1.   

    图片,大文本,二进制数据往数据库保存,用SQL语句是可以实现的.如果各位有兴趣我可以贴一个
    例子.
      

  2.   


    测试环境
     Server : Winnt4.0,SQL Server 7.0 
     Client : Win2000(pro),Delphi5.0//测试用表
    CREATE TABLE [dbo].[Image_test] (
    [ID] [int] IDENTITY (1, 1) NOT NULL ,
    [image_] [image] NULL 
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    //\
    //程序 delphi5.0编译,运行成功
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, ADODB;type
      TForm1 = class(TForm)
        Button1: TButton;
        adoComm: TADOCommand;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}function _strtohex_sql(const s:string):string;
    var
      iCount:integer;
      Value,CH,CL:Byte;
      PS,P:Pointer;
    begin
      SetLength(Result,2 * Length(s) + 2);
      Result[1]:='0';Result[2]:='X';
      P:=@Result[3];
      PS:=@S[1];
      for iCount := 1 to Length(s) do
      begin
        Value := Byte(PS^);
        CH:=(Value shr 4) and $0F;
        CL:=Value and $0F;
        if CL < $0A then CL := CL + $30 else CL := CL + $37;
        if CH < $0A then CH := CH + $30 else CH := CH + $37;
        Byte(P^):=Ch;
        P:=Pointer(Integer(P)+1);
        Byte(P^):=CL;
        P:=Pointer(Integer(P)+1);
        PS:=Pointer(Integer(PS)+1);
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    const
        sqlInsert ='Insert Image_test (Image_) Values(%s)';
    var
      s:string;
      MS:TMemoryStream;
    begin
      MS := TMemoryStream.Create();
      MS.LoadFromFile('C:\安装程序.bmp'); //FileSize = 308,280 bytes
      SetLength(S,MS.Size);
      Move(MS.Memory^,Pointer(S)^,MS.Size);
      MS.Free();
      S := _strtohex_sql(S);
      S := format(sqlInsert,[S]);
      adoComm.CommandText := S;
      adoComm.Execute();
    end;end.