I am testing one application that handles files (stored in SQL Server using FILESTREAM
). It is a Delphi 32bit application.
Opening an XLS document stored in the database (originally saved with Office 2003) gives an error from Excel 2010 64bit. Is there some known compatibility issue of Office 2010 64bit with 32bit applications?
When opening the file Excel gives one of the following error messages:
Impossible to open the file FILE because of problems in contents
Impossible to open the file because some parts are missing or not valid
Opening a file on machine A with Office 2007 opens the file with no problems. Opening the same file on machine B with Office 2010 produces the error message. Opening again on machine A there is also an error message! In all these steps I am just reading from the database, not writing. So why does this can happen?
varbinary(max)
field for the specific ID_Document.TBlobField(sqlQuery.FieldByName('DOCUMENT')).SaveToFile(sDestinationPath + FileUniqueName + .zip');
Windows.CopyFile
TZipforge
componentFileSetReadOnly
function.ShellExecute(0, 'open', PWideChar(FIleName), '', '', SW_SHOWNORMAL);
As you can see there is nothing that writes back to the database. Once the file is extracted from TBlobField
it is even copied to another place before unzipping and opening it.
Office has been reinstalled and now everything works, the problem of corruption was due to a conflict with an open Office installation that asked "do you want to fix the office installation?". Anyway the problem still remains, because I cannot understand what happened. How can I corrupt a file in the database if I extract it in a folder and open it from the folder without writing anything back to database?
Solved: it was a bug in my program. There was an error in the logic that persisted the document status and by mistake sometimes Is_File_Compressed
was set to False
, even if it is true.
Thanks for the support.