Link to home
Start Free TrialLog in
Avatar of Amandina
AmandinaFlag for Denmark

asked on

PDF files into SQL 2008 Varbinary(Max)

Hi,
I am posting pdf files into a table in my sql server. The field in the table is of type Varbinary(MAX).
It works fine with small size pdf-files but when I try to put larger files into the field I get the error:
eoleException with message the text, ntext, or image pointer value conflicts with the column name specified.

the code is:


var
InS, OutS: TStream;

begin

InS := TFileStream.Create(filbox.filename, fmOpenRead);

OutS := tbl_dok.CreateBlobStream(tbl_dokdokument, bmWrite);

OutS.CopyFrom(InS, InS.Size);

OutS.Free;
InS.Free;
tbl_dok.Post;

end;

Tbl_dok is an ADOTable.

Hope someone can help.....
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

How big is your PDF? Max does not mean limitless!

As you can read from https://msdn.microsoft.com/en-us/library/ms188362.aspx
max indicates that the maximum storage size is 2^31-1 bytes
Avatar of Amandina

ASKER

The size is only 1.557 KB
ASKER CERTIFIED SOLUTION
Avatar of Zberteoc
Zberteoc
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial