in reply to Extracting binary data from mssql

define "not working". File is empty? File doesn't contain what you expect? File is not created? Does the code enter the while loop at all? Not fetching any data? (update: )Are you using RaiseError?

Replies are listed 'Best First'.
Re^2: Extracting binary data from mssql
by bart (Canon) on Jul 25, 2007 at 22:05 UTC
    My guess is that the file is too short.

    The cause must be looked for in lack of proper initialization of LongReadLen.

      With that in mind, my guess is that the default of LongTruncOk being false should cause the fetch to fail (Update: Would LongReadLen being zero cause the fetch to fail, or fetch an empty string?), but RaiseError is probably false also, so we're not catching that error, though PrintError is probably true, so we should at least see the error, but the error isn't mentioned, so I'm not sure what's going on because there's too little info :-)
Re^2: Extracting binary data from mssql
by Anonymous Monk on Jul 26, 2007 at 13:25 UTC
    The loop runs and the records are fetched. All the data appears to be coming back. The files that are created definitely have data because they differ in byte size. The only success I saw was with a .doc file. After trying to open it, I see all the contents and everything looks fine. However, gif and jpg and other files don't work. It seems like all of the data is there but something along the lines of an end of file marker is missing. Any suggestions? If you need more info, please let me know.