Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to read an image from a GENERAL field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
01176470
Message ID:
01176511
Vues:
23
Thanks for clarify it! I thought general fields stored only the binary data sent to 'em like SQL Server image fields do.

>It's impossible to extract an image from VFP General field using your code.
>It''l rerurn the whole contents of the General field which cannot be used in the VFP Image control.
>
>>If original files are not available he can use ADO to bring the images back from the database. This is an example that uses SQL Server but making it work with VFP should not be difficult.
>>
>>
>>
>>*--- Coneccion: Method that establish a connection to the database
>>*--- Getrs    : Method that execute a T-SQL Sentence against the DB
>>*--- Desconectarse: Method to finish the connection
>>*--- Datos    : Property that holds the ADO Recordset object created
>>
>>Thisform.Coneccion()
>>	Thisform.Datos=Thisform.Getrs([Select * From Fotos Where Secuencia=6])
>>Thisform.Desconectarse
>>
>>cFile=ADDBS(SYS(2023))+Thisform.Datos.Fields('Nombre').Value
>>
>>IF FILE(cFile)
>>	ERASE &cFile
>>ENDIF
>>
>>oSt = CREATEOBJECT("ADODB.Stream")
>>oSt.Open
>>oSt.Type=1 &&&& adTypeBinary
>>
>>
>>oSt.Write(Thisform.Datos.Fields('Foto').Value)
>>oSt.SaveToFile(cFile)
>>oSt.Close()
>>Thisform.image1.Picture=cFile
>>Thisform.Refresh
>>
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform