Long Binary Data (type) to PDF in table

VBAtoAccess

New member
Local time
Today, 13:28
Joined
Sep 21, 2011
Messages
1
(Access 2007) using VBA I need to convert "Long binary data" type to pdf "Adobe Acrobat Document" in an OLE Object Access table.

If I drop/drag the document into the table I get the "Adobe Acrobat Document" type that allows me to double click to open.

If I copy the same file using VBA, the "Long binary data" type doesn't allow me to open with double click.

Any ideas how to convert the file to a PDF format during, before, or after I copy the file to the table? I don't see any way to cast the file to be an OLE Object of PDF type... Any help - great appreciated.

Code snippet.
-----
Dim curDatabase As DAO.Database
Dim MyTrackingTable As DAO.Recordset

Set curDatabase = CurrentDb()
Set MyTrackingTable = CurrentDb.OpenRecordset("TrackingTableName")

MyTrackingTable.AddNew
MyTrackingTable("Report") = PathToFile + "DaileyReport.pdf"
MyTrackingTable.Update
-----
 
I tried this once long long ago... 1995 range on Windows 3.1 running on top of OS/2. Only back then I was a Paradox for Windows developer.

Basically you want to store the binary data (BLOB) as a field in the database, correct?

I suspect that MS is doing some "extra magic" than merely storing the binary data of the file when you do it the DnD way.

If you truly did not corrupt the binary data which makes up the file, then it should be intact. Try reading the data back out of the table, write it to a new filename, and then crc32 / md5sum the files to make sure all of the 1's / 0's made the round trip in/out of the DB.

If that all passes, that confirms data integrity, so then it is some sort of extra magic MS can perform in certain instances.
 

Users who are viewing this thread

Back
Top Bottom