I have images stored in a SQL 2000 database and have created views in VFP to
access the tables. How do I actually read the binary data stored in the
table to be displayed lets say in a image control?
I was hoping something like this would work:

thisform.image1.picture=mysqltable.image && but if doesnt.

Is there a different control I need to use or is there a way to make the
above example work.

Many thanks
Shahriar

Re: Image by Eric

Eric
Wed Feb 09 01:50:48 CST 2005

Hello, Shahriar!
You wrote on Wed, 09 Feb 2005 07:21:13 GMT:

S> thisform.image1.picture=mysqltable.image && but if doesnt.

If you're using VFP9, you can use the new PictureVal property:
image.pictureval = mysqltable.image

In earlier versions, you have to save the binary data to a file first:

strtofile(mysqltable.image, "yourimage.bmp")
image.picture = "yourimage.bmp"

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Re: Image by Shahriar

Shahriar
Wed Feb 09 02:01:08 CST 2005

Hi Eric
Thank you for your quick response - as usual :)

I wrote a JPG file to a sql table like this.
APPEND GENERAL image FROM "c:\data\myfile.jpg"

When I use strtofile(mysqltable.image, "myfile.jpg"), i get the following
error message:
Function argument value, type or count is invalid

Thank you.
Shahriar

"Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
news:%230uDPwnDFHA.3888@TK2MSFTNGP09.phx.gbl...
> Hello, Shahriar!
> You wrote on Wed, 09 Feb 2005 07:21:13 GMT:
>
> S> thisform.image1.picture=mysqltable.image && but if doesnt.
>
> If you're using VFP9, you can use the new PictureVal property:
> image.pictureval = mysqltable.image
>
> In earlier versions, you have to save the binary data to a file first:
>
> strtofile(mysqltable.image, "yourimage.bmp")
> image.picture = "yourimage.bmp"
>
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
>
>



Re: Image by Dan

Dan
Wed Feb 09 11:00:59 CST 2005

Don't use general fields. Try a binary memo field instead.

Shahriar wrote:
> Hi Eric
> Thank you for your quick response - as usual :)
>
> I wrote a JPG file to a sql table like this.
> APPEND GENERAL image FROM "c:\data\myfile.jpg"
>
> When I use strtofile(mysqltable.image, "myfile.jpg"), i get the
> following error message:
> Function argument value, type or count is invalid
>
> Thank you.
> Shahriar
>
> "Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
> news:%230uDPwnDFHA.3888@TK2MSFTNGP09.phx.gbl...
>> Hello, Shahriar!
>> You wrote on Wed, 09 Feb 2005 07:21:13 GMT:
>>
>>> thisform.image1.picture=mysqltable.image && but if doesnt.
>>
>> If you're using VFP9, you can use the new PictureVal property:
>> image.pictureval = mysqltable.image
>>
>> In earlier versions, you have to save the binary data to a file
>> first:
>>
>> strtofile(mysqltable.image, "yourimage.bmp")
>> image.picture = "yourimage.bmp"
>>
>> --
>> Eric den Doop
>> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By
>> VFP8