string ls_pathname, ls_filename, ls_filtro
integer li_clave, li_file
blob lb_usu_foto, lb_temp
ChangeDirectory("C:\Documents and Settings\COR_ACHAIREZ\Mis documentos\Mis imágenes")
ls_filtro = "Archivos de Imagenes (*.bmp;*.gif;*.jpg;*.jpeg;*.png),*.bmp;*.gif;*.jpg;*.jpeg;*.png"
if GetFileOpenName("Archivo de Imagen:", ls_pathname, ls_filename , "jpg", ls_filtro) = 0 then return
li_file = FileOpen(ls_pathname, StreamMode!)
if li_file = -1 then
messagebox('Error','Falló la apertura del archivo imagen',stopsign!)
return
else
li_clave = integer(sle_clave.text)
DO WHILE FileRead(li_file,lb_temp) > 0
lb_usu_foto += lb_temp
LOOP
FileClose(li_file)
p_foto.SetPicture(lb_usu_foto)
UPDATEBLOB nada
SET foto = :lb_usu_foto
WHERE clave = :li_clave;
if sqlca.sqlcode = -1 then
messagebox("Error","No se pudo ejecutar la query actualiza foto~n~r" + sqlca.sqlerrtext, stopsign!)
return
end if
end if