Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pdf - again ... vb6, mssql 2005

Status
Not open for further replies.

northrd

Programmer
May 18, 2003
74
0
0
AU
I have "a.pdf". I view it perfectly. I now store it (data stream) as a nvarbin(max) in a sql 2005 table (the reason I do this is NOT the issue). I now retrieve it (data stream) and I cannot view it.
I get the error message "file does not begin with %PDF-" within the standard version 8 viewer.

I am using Adobe Acrobat 7.0 browser control type library.

Any ideas?
 
<Any ideas?

Well, what have you done to address the error that you get?
 
nvarbin(max)

I don't think so!

There's no such data type in SQL Server 2005. You may be thinking of one of these...

nvarchar(max)
varchar(max)
varbinary(max)

The "n" in front of the data type indicates that the field is capable of storing unicode characters. Unicode characters require 2 bytes to store each character, where as the non-unicode (ASCII) version requires 1 byte per character. Since you are storing a file in the field (and not the characters that make up the file), you must be using varbinary(max).

I urge you to verify the data type of the column. If it is nvarchar, then you should change in to varbinary. If you are not sure how to check the data type, open the SQL Server Management Studio. Open a query window and run this...

Select Data_Type From Information_Schema.Columns Where Table_Name = 'Your Table Name Here' And Column_Name = 'Your Column Name Here'



-George

"the screen with the little boxes in the window." - Moron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top