Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to read an image from a GENERAL field
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
SAMBA Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01176470
Message ID:
01176511
Views:
22
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
Previous
Reply
Map
View

Click here to load this message in the networking platform