[Gambas-user] Blob management

David Villalobos Cambronero david_villalobos_c at ...43...
Fri Jun 26 15:59:11 CEST 2009


It doesn't work, the file is saved emty.

Benoit, any idea?

 Regards


--
David



----- Original Message ----
From: Werner <wdahn at ...1000...>
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Sent: Thursday, June 25, 2009 9:39:52 PM
Subject: Re: [Gambas-user] Blob management

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)



------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user








More information about the User mailing list