[Gambas-user] pictures inside a DB

Steven Lobbezoo steven at ...1652...
Fri Mar 30 14:12:14 CEST 2007


Hamilton,

If You use direct SQL statements with exec (i.e; SResult = 
MyDb.Exec("Select ..........................") then the rsulting resultset is 
read-only. In this case you have to update yourself like in :
SREsult = MyDb.Exec("Update TableX .............................;")

If You want gambas to do this for you, You have to use it's sql layer, and 
open a table for update.
I use both, since the layer is not very sophisticated, and verry fast you will 
run into sql statements that cannot be represented by it.

Steven


Le vendredi 30 mars 2007 14:55, Hamilton Geminiano Andrioli Junior a écrit :
> Steven, i didn't understand your code.
> see:
>
> ' DIM sData AS String
> ' sData = File.Load("/file/path")
> ' MyResult!MyBlobField = sData
>
>
> How can i make a database connection. I said that, because i work only
> with SQL, and to update a database i use "update customers set
> picture='" & Sdata & "' where id=xx"
> If i make what you said, Gambas returns me: Result is read-only.
>
> What i'm doing wrong?
>
> []'s
> Hamilton From Brazil!
>
> Steven Lobbezoo escreveu:
> >   rsK = db.Exec("select Thumb, Id from Photos where prop_num = " &
> > Str(Id)) IF rsK.available = TRUE THEN
> >     FOR EACH rsK
> >       sData = rsK!Thumb.Data
> >       ' write the photo to local file
> >       File.Save("~/TempPhot" & Str(rsK!Id) & ".jpg", sData)
> >       ' Fill with the image
> >       AddImage("~/TempPhot" & Str(rsK!Id) & ".jpg", Str(rsK!Id))
> >       KILL "~/TempPhot" & Str(rsK!Id) & ".jpg"
> >
> > AND
> >
> > ' TO put a file inside a blob field:
> >
> > ' DIM sData AS String
> > ' sData = File.Load("/file/path")
> > ' MyResult!MyBlobField = sData
> >
> >
> > Well, I only got a lot of help, and adapted it a bit.
> > Still looking for a possibility to read blobs without
> > writinig them to files !
> >
> > Steven
> >
> > Le lundi 26 mars 2007 18:18, Hamilton Geminiano Andrioli Junior a écrit :
> >> Please, i have to put some pictures inside a mysql database.
> >> How can i save and retrieve those?
> >>
> >> Anyone can help me?
> >>
> >> thanks.
> >>
> >> Hamilton
> >> ------------------------------------------------------------------------
> >>- Take Surveys. Earn Cash. Influence the Future of IT
> >> Join SourceForge.net's Techsay panel and you'll get the chance to share
> >> your opinions on IT & business topics through brief surveys-and earn
> >> cash
> >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
> >>V _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
> > your opinions on IT & business topics through brief surveys-and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> 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