Table name: pics
Field Memo(binary): pict
I saved a JPEG file to a memo(binary) field with the following code:
mbpict=filetostr("c:\pictures\xxxx.jpg")
sele pics
append blank
replace pict with mbpict
I have a form with a grid displaying other info from the table pics.dbf. As
I move through each record in the grid I want to display the jpg saved to a
memo(binary) field with filetostr(). I've gone to the AfterRowColumnChange in
the Grid and added the following code:
STRTOFILE(pics.pict,"temp.jpg")
thisform.image1.PictureVal="temp.jpg"
thisform.refresh
Nothing displays.
Once I get it to display I have another issue that I believe I can use to
append multiple jpg's to a table. Originally I was appending to a general
field but I've noticed most have suggested saving it to a memo(binary). That
sounds better since you can't display a JPG in an Image control (only the
name). If I could I might keep the use of the general field.
I use GETDIR() to locate the pictures I want to pull in. I save them in a
general field. If I'm going to save them in a memo(binary) field what would
the code be? Below is the code to append to the general field.
Current code:
CD GETDIR()
nFiles = ADIR(ajpeg, "*.jpg")
IF nFiles > 0
FOR i = 1 to nFiles
APPEND BLANK
APPEND GENERAL pic FROM ajpeg(i,1)
REPLACE pics.descripe WITH ajpeg(i,1)
replace picdate WITH DATE()
ENDFOR
ENDIF
Thanks
Rusty Gallo