Why this code didn't work? (I take it from a site):
Many developers choose General fields because they don't want to have the files separate from the table. The user shouldn't be able to break the application by accidentally deleting the image files.
In this situation, use a binary memo field instead of a General field. You can use this line to get the file into the memo field:
Append Memo Img From <File> Overwrite
where Img is the name of the binary memo field. In Visual FoxPro 6.0, use an image control to display such a .JPEG file. This requires the following code in the Refresh event of the form:
Local lcFile
* Delete the previous image, if it exists
If File(This.Image.Picture)
Erase (This.Image.Picture)
Endif
* Create a new temporary file on disk
* SYS(2023) returns the current temporary path
lcFile = SYS(2023)+"\"+Sys(3)+".JPG"
Copy Memo myTable.Img to (m.lcFile)
This.Image.Picture = m.lcFile
Many developers choose General fields because they don't want to have the files separate from the table. The user shouldn't be able to break the application by accidentally deleting the image files.
In this situation, use a binary memo field instead of a General field. You can use this line to get the file into the memo field:
Append Memo Img From <File> Overwrite
where Img is the name of the binary memo field. In Visual FoxPro 6.0, use an image control to display such a .JPEG file. This requires the following code in the Refresh event of the form:
Local lcFile
* Delete the previous image, if it exists
If File(This.Image.Picture)
Erase (This.Image.Picture)
Endif
* Create a new temporary file on disk
* SYS(2023) returns the current temporary path
lcFile = SYS(2023)+"\"+Sys(3)+".JPG"
Copy Memo myTable.Img to (m.lcFile)
This.Image.Picture = m.lcFile