[Gambas-user] Blob management
Werner
wdahn at ...1000...
Fri Jun 26 05:39:52 CEST 2009
David Villalobos Cambronero wrote:
> Forgot to add more details.
>
> And yes, the example works fine but I don't get it to work in my app.
>
> Here is the senario:
>
> I got a table with a picture (just a record) and I want to save it to the disk, (PictureDatabase does it by the PictureBox not directly).
>
> Driver: mysql, Mandriva 2009.1 32 bits, Gambas 2
>
>
> Here are my statements
>
> DIM hResultado AS Result
>
> IF NOT Exist("/tmp/mas") THEN MKDIR "/tmp/mas"
> hResultado = $hConn.Exec("SELECT * FROM `Pics`")
> File.Save("/tmp/1.jpg", hResultado["Pic"].Data)
>
> Or can you provide me an example of saving to disk an image stored in a database?
>
>
> Regards
>
>
> --
> David
>
>
>
> ----- Original Message ----
> From: Benoît Minisini <gambas at ...1...>
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Sent: Thursday, June 25, 2009 3:29:20 PM
> Subject: Re: [Gambas-user] Blob management
>
>
>> Hi, is there a problem with this instuction?
>>
>> hResultado = $hConn.Exec("SELECT Pic FROM Pics")
>> File.Save("/tmp/1.jpg", hResultado["Pic"].Data)
>>
>>
>> I can't get them work!
>>
>> Regards
>>
>>
>> --
>> David
>>
>>
>
> Can you give more details? (versions, database driver)...
>
> Does the PictureDatabase example work?
>
>
You are using constructs that I have never seen before. Would this be
better?
DIM hResultado AS Result
IF NOT Exist("/tmp/mas") THEN MKDIR "/tmp/mas"
hResultado = $hConn.Exec("SELECT * FROM `Pics`")
File.Save("/tmp/mas/1.jpg", hResultado!fieldname)
More information about the User
mailing list