Hi Michel.
When I was checking directions for saving pictures in table fields
I got many advices about NEVER using "General Fields" for doing anything
because, as many users said, not only the file data is stored in the field but also
other informations like default application. One user said it stores even
"the colors of your grandmother shoes" :)).
I think your problem is that when you restore the data from the field
other information is coming in the file making it corrupted for the application
that uses it.
If it's a VFP table try to see if Blob is good. According to VFP documentation:
"To store binary data of any kind, such as ASCII text, an executable (.exe) file,
or a stream of bytes, and with indeterminate length, use the Blob data type."
I'm just guessing, but I can make some tests.
>Hi Cetin
>
>In message #
662467, you describe an approach of extracting a general field into a file by the use of the 579 marker. I tried this:
>
>
>FUNCTION SaveIt2
>PARAMETER tcFile
>lcTemp = sys(2015)
>lcOutFileName = "New-"+ALLTRIM(STR(RECNO()))+"."+tcFile
>copy fields z_data to (lcTemp) next 1
>
>Hin = fopen(lcTemp+".fpt")
>hout=fcreate(lcOutFileName)
>lnSize=fseek(hin,0,2)
>fseek(hin,0x204,0)
>lnSize = 0
>for ix=4 to 1 step -1
> lnSize=lnSize+asc(fread(hin,1))*256^(ix-1)
>endfor
>fwrite(hout,fread(hin,lnSize),lnSize)
>=fclose(hin) and fclose(hout)
>erase (lcTemp+'.*')
>
>
>The various types of documents I have are:
>
>Word.Document.12
>AcroExch.Document.7
>Excel.Sheet.8
>Word.Document.8
>
>In all of them, I end up in non recognized document when I try to open them in Word, Excel of Acrobat Reader. Would you have or anyone has an idea about what I am missing here?
***
TONY Nascimento
*****************
"Your mind is like a parachute. It only works if it is open" - Anthony J. D'Angelo
"The desire to know is natural to good men" - Leonardo da Vinci