[AccessD] Opening Files from BLOB in SQL Server 2012

Stuart McLachlan stuart at lexacorp.com.pg
Thu Oct 29 18:18:47 CDT 2015


How are you writing the files?

i.e. Are you doing an OPEN.... FOR OUTPUT... 
or OPEN... FOR BINARY... 

It sounds like the write process is trying to convert Wide Characters to ASCII.
Make sure that you are opening for BINARY

(If the code was for 97 and earlier, it would have text stored as ASCII so you would not have 
the Wide -> ASCII conversion concerns)



On 29 Oct 2015 at 23:03, Jurgen Welz wrote:

> I'm attempting to access files of various types stored by an
> accounting application.  I've found an old knowledge base article
> applicable to Access versions 1 though 97: 
> https://support.microsoft.com/en-us/kb/103257   
> 
> I'm using an ODBC connection because that's what we have been using
> universally and it remains solid.  It works to read the file data from
> the database column because the binary data I'm pulling matches the
> file size of the item stored.  The problem I'm having is when I write
> the file to disk, it is showing up with exactly 1/2 the size.  It is
> like I'm writing a 32 bit file into a 16 bit file system.  Attempts to
> open the files written to the file system result in a report that the
> file is damaged or corrupt.
> 
> If, for example, I've got a file made of 10 chunks 100 bytes long plus
> 30 bytes, as the file is written and the first 30 bytes is added to
> the file, it reports as size of 15 bytes and an additional 50 bytes as
> each additional chunk is appended to the file.
> 
> Does anyone have a suggestion as to how I might store and or just open
> these files.  File types are Office documents, various image types,
> pdfs, msg or any number of other file types for which we generally
> have applications. We are running Windows Server 2012 R2 64 bit and
> Office 32 bit.
> 
> Jurgen Welz
> Edmonton, AB
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list