如何将DB 数据库导入到SQL Sever数据库,其中DB数据库中有个字段内容为BLOB形式.
我直接用SQL Sever导入,BLOB字段导不了.

解决方案 »

  1.   

    倒,我看错了,我以为你要倒blog(博客)的数据
      

  2.   

    //例子如下:可以导入任意类型的文件
    procedure TFm_Treaty_Add.SpeedButton11Click(Sender: TObject);
    begin
    ADOCommand1.CommandText:='Insert Into User_Document (文件名,说明文字,文书,属性) Values (:文件名,:说明文字,:文书,:属性)';
    ADOCommand1.Parameters.ParamByName('文件名').Value:=Lb_FileName.Caption;
    ADOCommand1.Parameters.ParamByName('说明文字').Value:=Edit1.Text;
    if RadioButton1.Checked then
    ADOCommand1.Parameters.ParamByName('属性').Value:=Form1.User_Code;
    if RadioButton2.Checked then
    ADOCommand1.Parameters.ParamByName('属性').Value:=0;
    //这句是你要的吧
    ADOCommand1.Parameters.ParamByName('文书').LoadFromFile(OpenDialog1.FileName,ftBlob);//(ADOBS,ftBlob);
    try
    ADOCommand1.Execute;
    Application.MessageBox('文档已成功导入数据库。','导入完成',Mb_ok+Mb_IconInformation);
    Close;
    except
     on E:Exception do
       begin
         Application.MessageBox(PChar('操作遇到错误被终止,系统返回的错误信息如下:'+#13+#13+E.Message) ,'操作失败',Mb_OK+Mb_IconInformation);
       end;
    end;
    end;呵呵,以前很多人贴过的,俺也在做这个问题,顺手给你!
      

  3.   

    SQLSERVER直接导入是不行的,一定要用流的形式吧...