I've created a database in Access 2000 and inserted my pdf files as OLE objects from within the database table view but when I get them out I have problems.
It seems as my files have extra information at the head of them. From what I gather a pdf file's binary data should start with '%PDF-' but the first couple of lines of mine seem to be as shown below. Is this an additional header or something that needs to be removed? (I got this data simply by removing the content type so that the binary data would be written as text).
The code works fine on the original file but not when I get it from the database.
Code:
Dim EAMS_Database
Set EAMS_Database = Server.CreateObject("ADODB.connection")
EAMS_Database.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\Inetpub\wwwroot\db.mdb")
Set objRS = EAMS_Database.Execute("select pdf_object from articles where EntryId=1")
Response.Buffer = True
Response.Clear
Response.ContentType = "application/pdf"
Response.BinaryWrite objRS(0)
Response.end
EAMS_Database.Close
Any ideas?
Code: 7%ÿÿÿÿAcrobat DocumentAcroExch.DocumentAcroExch.DocumentÔÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿèþÿÿÿáýÿÿÿýÿÿÿýÿÿÿ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€Root Entryÿÿÿÿÿÿÿÿeʸü¡Ð…DESTУƒóÄOle ÿÿÿÿÿÿÿÿÿÿÿÿContentsÿÿÿÿ ²OlePres000ÿÿÿÿÿÿÿÿPþÿÿÿ !"#$%&'()*+,-./0123456789:þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ«‹Lp4õ—XäÂzÈÈr“DÅ„öó~9šÇ¤]Ë;Ci’F7¿®êoÿÿÿÿÿÿÿÿì ! `’ ÿÿÿ¥A ƈ 9( @ÿÿÿ ¥9II3ò%9999444449999-]IŸ%49494444999-]Ÿ%%%%%%%%%%%%%%%$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?ÿÿÿ!A Ff ‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàþÿÿÿâãäåæçþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ%PDF-1.4 %âãÏÓ 143 0 obj<>stream xÚ¬WKoÛFæßèm_âƒÁ}?‚ €,hàØM$9(>°2! uDƒ’ûÏ·ývWÑ‹JEE>ÃÝï›gv—B#!‰3A’“✤ åIIÚx’ŠŒ°$-¯H:²J’ôä”&ÅÈs y‘‹•„uÎ5¸q!Àä¶kuŒ¾X~ƒKâN¿ÝUx~/‹ÛÉt U‚6¦·‘ÉÊš¹ªç¼zÊ;÷óWá0xMÎ8u&5]U—ßPh”®RC†mÓôï ”s 9 Fíš·êG±_u{xÞ_ +•¤Fû©9¯nŸáxpdÖÒBc ¡E&û5