Board index » delphi » Help with MSSQL Blob Insert Problem

Help with MSSQL Blob Insert Problem

Hello, i'm having a problem inserting an image into a table if it's over a
certain size...  30k or so i think.
This table has two image columns and a primary key.  I read a ti on borlands
site about this problem and they suggested doing an "insert into
dbo.mytablename".  Well this doesn't fix my problem, any suggestions?

I'm using a parameterized query and loadfromstream.

Rick

 

Re:Help with MSSQL Blob Insert Problem


The BDE has big time problems with Image and Text fields on MSSQL.  I would
recommend that you write the SQL statement directly through DBLIB and bypass
the BDE.  That is the only way we got it to work.

Re:Help with MSSQL Blob Insert Problem


How to use Delphi write SQL statement directly through DBLIB and bypass the
BDE.

Quote
Steve Morrison <Bigdogs2...@hotmail.com> wrote in message

6r1qq7$b...@forums.borland.com...
Quote

>The BDE has big time problems with Image and Text fields on MSSQL.  I would
>recommend that you write the SQL statement directly through DBLIB and
bypass
>the BDE.  That is the only way we got it to work.

Re:Help with MSSQL Blob Insert Problem


In article <6rt0f0$f0...@forums.borland.com>, "Forest  John" <forestj...@usa.net> wrote:

Quote
>How to use Delphi write SQL statement directly through DBLIB and bypass the
>BDE.

>Steve Morrison <Bigdogs2...@hotmail.com> wrote in message
>6r1qq7$b...@forums.borland.com...

>>The BDE has big time problems with Image and Text fields on MSSQL.  I would
>>recommend that you write the SQL statement directly through DBLIB and
>bypass
>>the BDE.  That is the only way we got it to work.

Here is how we did it.

   with stpCorrespondence_Add_Empty do
   begin
     ParamByName('@Claim_ID').Clear;
     ParamByName('@Policy_ID').Clear;
     ParamByName('@Vendor_ID').Clear;
     ParamByName('@Correspondence_Type').AsString := 'Memo';
     ParamByName('@Description').AsString := 'Memorandum';
     ParamByName('@Transmittal_Date').AsDateTime := Now;
     ParamByName('@Agent_ID').AsString := sAgentID;
     ExecProc;
     iInsertInstance := ParamByName('@New_Correspondence_Inst').AsInteger;
   end;
   with CorrespondenceQuery do
   begin
     Close;
     Open;
     First;
     // Keep the ole object from loading for each row we visit.
     CorrespondenceSource.OnDataChange := Nil;
     repeat
       if FieldByName('CORRESPONDENCE_INST').AsInteger = iInsertInstance then
         Break;
       Next;
     until Eof;
     CorrespondenceSource.OnDataChange := CorrespondenceSourceDataChange;
     CorrespondenceSourceDataChange(Self, nil);
     Edit;
   end;

The stpored procedure stpCorrespondence_Add_Empty added the record and
returned the row identity value in the parameter @New_Correspondence_Inst.

Other Threads