Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
General field by the use of the marker
Message
De
11/12/2009 06:15:03
 
 
À
11/12/2009 01:38:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01438561
Message ID:
01438578
Vues:
50
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) && Move file pointer to offset 0x204 where file size is stored
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform