Mensaje
 
a
24/03/2010 22:06:14
Hee Lim Wang
Fantasy Software Enterprise
Malaysia
General information
Foro:
Visual FoxPro
Category:
Bases de datos, tablas, vistas, índices y SQL
Miscellaneous
ID de la conversación:
01455978
ID del mensaje:
01457089
Views:
62
This message has been marked as the solution to the initial question of the thread.
>strtofile(tmp.bImage, 'c:\myPicture2.jpg')
>c:\myPicture2.jpg is the same as myPicture.jpg and can be added into Image1 control manually
>but cannot auto added with program coding......
>
>>CURSORSETPROP("MapBinary", .T., 0)
>>SQLExec(lnHandle,"select bImage from TableImage","tmp")
>>Thisform.Image1.Picture=strtofile(tmp.bImage, 'c:\myPicture2.jpg')
>>thisform.Refresh
>>
>Program error : Data type is invalid for this property
>
>
>if I use pictureval
>>Thisform.Image1.Picture=strtofile(tmp.bImage, 'c:\myPicture2.jpg')
>
>Error with Image1 : PictureVal : property value is invalid.

Try
CURSORSETPROP("MapBinary", .T., 0)
SQLExec(lnHandle,"select bImage from TableImage","tmp")
    strtofile(tmp.bImage, 'c:\myPicture2.jpg')
  Thisform.Image1.Picture= 'c:\myPicture2.jpg'
thisform.refresh()
though this
CURSORSETPROP("MapBinary", .T., 0)
SQLExec(lnHandle,"select bImage from TableImage","tmp")
Thisform.Image1.PictureVal = alltrim(tmp.bImage)
thisform.refresh()
should work as well - there are problems with certain images, as I recall from Calvin Hsia blog.

Try first the second approach and if would not work, try the first.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Responder
Mapa
Ver