[Gambas-user] pictures inside a DB
Steven Lobbezoo
steven at ...1652...
Fri Mar 30 14:19:33 CEST 2007
Let me send you some examples,
it's work in progress, but i hope
it will help you.
Steven
(see attachement)
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
-------------- next part --------------
# Gambas Form File 1.0
{ Form Form
MoveScaled(0,0,96,83)
'Move(0,0,672,581)
Background = &HFFFFBF&
Expand = True
Text = ("")
Icon = Picture["icon:/16/color"]
AutoResize = True
{ ToolButton1 ToolButton TBs
Name = "ToolButton1"
MoveScaled(1,1,6,3)
'Move(7,7,42,21)
Background = &HFFFFBF&
Tag = "No|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("No")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton2 ToolButton TBs
Name = "ToolButton2"
MoveScaled(9,1,11,3)
'Move(63,7,77,21)
Background = &HFFFFBF&
Tag = "Prenom|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Prenom")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton3 ToolButton TBs
Name = "ToolButton3"
MoveScaled(23,1,10,3)
'Move(161,7,70,21)
Background = &HFFFFBF&
Tag = "Nom|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Nom")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton4 ToolButton TBs
Name = "ToolButton4"
MoveScaled(41,1,12,3)
'Move(287,7,84,21)
Background = &HFFFFBF&
Tag = "Adresse|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Adresse")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton5 ToolButton TBs
Name = "ToolButton5"
MoveScaled(63,1,10,3)
'Move(441,7,70,21)
Background = &HFFFFBF&
Tag = "Ville|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Ville")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton6 ToolButton TBs
Name = "ToolButton6"
MoveScaled(82,1,9,3)
'Move(574,7,63,21)
Background = &HFFFFBF&
Tag = "Pays|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Pays")
Picture = Picture["icon:/16/redo"]
}
{ VSplit1 VSplit
MoveScaled(0,4,96,79)
'Move(0,28,672,553)
Expand = True
{ VPanel1 VPanel
MoveScaled(1,1,94,42)
'Move(7,7,658,294)
Expand = True
AutoResize = True
{ GridView2 GridView
MoveScaled(-1,-1,94,43)
'Move(-7,-7,658,301)
Background = &HFFFFBF&
Foreground = &H404040&
ToolTip = ("Clique une propriétaire\npour voir / changer les\ndétails de celle si")
Expand = True
Scrollbar = Scroll.Vertical
AutoResize = True
}
}
{ Panel1 Panel
MoveScaled(1,44,93,34)
'Move(7,308,651,238)
{ Prenom TextBox
MoveScaled(10,0,35,3)
'Move(70,0,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ Nom TextBox
MoveScaled(10,4,35,3)
'Move(70,28,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ TextLabel1 TextLabel
MoveScaled(0,4,5,3)
'Move(0,28,35,21)
Text = ("Nom :")
}
{ TextLabel3 TextLabel
MoveScaled(0,8,10,3)
'Move(0,56,70,21)
Text = ("Téléphone :")
}
{ Telephone TextBox
MoveScaled(10,8,35,3)
'Move(70,56,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ Fax TextBox
MoveScaled(10,12,35,3)
'Move(70,84,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ TextLabel4 TextLabel
MoveScaled(0,12,10,3)
'Move(0,84,70,21)
Text = ("Fax :")
}
{ TextLabel5 TextLabel
MoveScaled(0,16,10,3)
'Move(0,112,70,21)
Text = ("Portable :")
}
{ Portable TextBox
MoveScaled(10,16,35,3)
'Move(70,112,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ TextLabel2 TextLabel
MoveScaled(0,0,7,3)
'Move(0,0,49,21)
Text = ("Prenom :")
}
{ Button1 Button
MoveScaled(79,30,13,3)
'Move(553,210,91,21)
Background = &H800000&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour quitter le programme")
Text = ("Sortir")
}
{ TextLabel6 TextLabel
MoveScaled(0,20,10,3)
'Move(0,140,70,21)
Text = ("Travail :")
}
{ Travail TextBox
MoveScaled(10,20,35,3)
'Move(70,140,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ Email TextBox
MoveScaled(10,25,35,3)
'Move(70,175,245,21)
Background = &HFFFFBF&
Text = ("")
}
{ TextLabel7 TextLabel
MoveScaled(0,25,8,3)
'Move(0,175,56,21)
Text = ("E-Mail :")
}
{ Adresse TextArea
MoveScaled(57,12,36,7)
'Move(399,84,252,49)
Background = &HFFFFBF&
Text = ("")
}
{ TextLabel8 TextLabel
MoveScaled(47,12,9,3)
'Move(329,84,63,21)
Text = ("Adresse :")
}
{ TextLabel9 TextLabel
MoveScaled(47,20,8,5)
'Move(329,140,56,35)
Text = ("Code P- Ville")
}
{ TextLabel10 TextLabel
MoveScaled(47,25,10,3)
'Move(329,175,70,21)
Text = ("Pays :")
}
{ TextLabel11 TextLabel
MoveScaled(47,0,13,3)
'Move(329,0,91,21)
Text = ("Observations:")
}
{ Observations TextArea
MoveScaled(47,3,46,8)
'Move(329,21,322,56)
Background = &HFFFFBF&
Text = ("")
}
{ Code_Postal TextBox
MoveScaled(57,20,7,3)
'Move(399,140,49,21)
Background = &HFFFFBF&
Text = ("")
}
{ Ville TextBox
MoveScaled(66,20,27,3)
'Move(462,140,189,21)
Background = &HFFFFBF&
Text = ("")
}
{ Pays TextBox
MoveScaled(57,25,36,3)
'Move(399,175,252,21)
Background = &HFFFFBF&
Text = ("")
}
{ Detail Button
MoveScaled(4,30,12,3)
'Move(28,210,84,21)
Background = &H4E8036&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour voir des\ndétails supplementaires")
Text = ("+ Détails")
}
{ Mandat Button
MoveScaled(34,30,12,3)
'Move(238,210,84,21)
Background = &H4E8036&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour voir le(s)\nmandat(s) du \npropriétaire")
Text = ("Mandat(s)")
}
{ Delete Button
MoveScaled(64,30,12,3)
'Move(448,210,84,21)
Background = &H800000&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour supprimer\nle client selectionné(e) ?")
Text = ("Supprimer")
}
{ Nouveau Button
MoveScaled(49,30,12,3)
'Move(343,210,84,21)
Background = &H323C80&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour nettoyer\net entrer une nouveau\n---------Client------------\nAprès avoir remplit les\nchamps, une 2ième\nclique sauvegarde les\ndonnées !")
Text = ("Nouveau")
}
{ Chercher Button
MoveScaled(19,30,12,3)
'Move(133,210,84,21)
Background = &H4E8036&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour chercher\nune client spécifique")
Text = ("Chercher")
}
}
}
{ Details Panel
MoveScaled(0,1,95,46)
'Move(0,7,665,322)
Visible = False
Background = &HFFFFBF&
{ Fermer Button
MoveScaled(81,41,12,3)
'Move(567,287,84,21)
Background = &H4E8036&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour fermer \nle panneau 'détails'")
Text = ("Fermer +")
}
{ TextLabel12 TextLabel
MoveScaled(27,3,13,3)
'Move(189,21,91,21)
Text = ("Ã Ville, Pays :")
}
{ TextLabel13 TextLabel
MoveScaled(3,3,9,3)
'Move(21,21,63,21)
Text = ("Né(e) le :")
}
{ TextLabel14 TextLabel
MoveScaled(3,7,8,3)
'Move(21,49,56,21)
Text = ("Metier :")
}
{ TextLabel15 TextLabel
MoveScaled(3,11,17,3)
'Move(21,77,119,21)
Text = ("Quote-part proprio :")
}
{ TextLabel16 TextLabel
MoveScaled(27,11,3,3)
'Move(189,77,21,21)
Text = ("%")
}
{ TextLabel17 TextLabel
MoveScaled(3,15,11,3)
'Move(21,105,77,21)
Text = ("Relation :")
}
{ TextLabel18 TextLabel
MoveScaled(27,15,11,3)
'Move(189,105,77,21)
Text = ("Avec qui :")
}
{ TextLabel19 TextLabel
MoveScaled(3,19,11,3)
'Move(21,133,77,21)
Text = ("Depuis :")
}
{ TextLabel20 TextLabel
MoveScaled(27,19,15,3)
'Move(189,133,105,21)
Text = ("Ou (Ville, Pays) :")
}
{ TextLabel21 TextLabel
MoveScaled(3,23,12,3)
'Move(21,161,84,21)
Text = ("Conditions :")
}
{ TextLabel22 TextLabel
MoveScaled(75,19,5,3)
'Move(525,133,35,21)
Text = ("Noce :")
}
{ TextLabel23 TextLabel
MoveScaled(3,27,31,3)
'Move(21,189,217,21)
Text = ("Desciption Conditions / Observations")
}
{ Ne TextBox
MoveScaled(12,3,14,3)
'Move(84,21,98,21)
Background = &HFFFFBF&
Text = ("")
}
{ NeOu TextBox
MoveScaled(40,3,50,3)
'Move(280,21,350,21)
Background = &HFFFFBF&
Text = ("")
}
{ Metier TextBox
MoveScaled(12,7,78,3)
'Move(84,49,546,21)
Background = &HFFFFBF&
Text = ("")
}
{ Quote TextBox
MoveScaled(20,11,6,3)
'Move(140,77,42,21)
Background = &HFFFFBF&
Text = ("")
}
{ Mariage TextBox
MoveScaled(12,19,14,3)
'Move(84,133,98,21)
Background = &HFFFFBF&
Text = ("")
}
{ MariageOU TextBox
MoveScaled(41,19,30,3)
'Move(287,133,210,21)
Background = &HFFFFBF&
Text = ("")
}
{ Noce TextBox
MoveScaled(82,19,8,3)
'Move(574,133,56,21)
Background = &HFFFFBF&
Text = ("")
}
{ Conditions TextBox
MoveScaled(12,23,78,3)
'Move(84,161,546,21)
Background = &HFFFFBF&
Text = ("")
}
{ Conddesc TextArea
MoveScaled(3,30,75,14)
'Move(21,210,525,98)
Background = &HFFFFBF&
Text = ("")
}
{ DateChooser2 DateChooser
MoveScaled(27,18,44,20)
'Move(189,126,308,140)
Visible = False
Background = &H606060&
Foreground = Color.Foreground
ToolTip = ("Selectionnez une date")
}
{ Relation TextBox
MoveScaled(41,15,49,3)
'Move(287,105,343,21)
Background = &HFFFFBF&
Text = ("")
}
{ TypeLiaison ComboBox
MoveScaled(12,15,14,3)
'Move(84,105,98,21)
Background = &HFFFFBF&
Foreground = Color.Foreground
Text = ("ComboBox1")
List = [(""), ("Epouse"), ("Enfant"), ("Parent"), ("Paxé"), ("Famille"), ("Consort"), ("Associé"), ("Copro"), ("Divers")]
}
{ DateChooser1 DateChooser
MoveScaled(27,2,44,20)
'Move(189,14,308,140)
Visible = False
Background = &H606060&
Foreground = Color.Foreground
ToolTip = ("Selectionnez une date")
}
{ TextLabel24 TextLabel
MoveScaled(28,0,33,2)
'Move(196,0,231,14)
Font = Font["Bold"]
Text = ("........................... les détails ..........................")
}
}
{ Nombre TextLabel
MoveScaled(90,0,6,2)
'Move(630,0,42,14)
Font = Font["-1"]
ToolTip = ("Nombre des \nenregistrements")
Text = ("TextLabel25")
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FormB.class
Type: application/x-java
Size: 12336 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20070330/082b999a/attachment.bin>
-------------- next part --------------
# Gambas Form File 1.0
{ Form Form
MoveScaled(0,0,110,86)
'Move(0,0,770,602)
Text = ("Revimmo - Les Agences")
{ GridView2 GridView
MoveScaled(1,5,69,24)
'Move(7,35,483,168)
ToolTip = ("Clique une agence\npour voir les détails")
}
{ TextLabel1 TextLabel
MoveScaled(2,31,9,3)
'Move(14,217,63,21)
Text = ("Nom")
}
{ TextLabel2 TextLabel
MoveScaled(2,36,11,3)
'Move(14,252,77,21)
Text = ("Addresse")
}
{ TextLabel3 TextLabel
MoveScaled(2,41,11,3)
'Move(14,287,77,21)
Text = ("PCode + Ville")
}
{ TextLabel4 TextLabel
MoveScaled(2,56,11,3)
'Move(14,392,77,21)
Text = ("Tcp-IP")
}
{ TextLabel5 TextLabel
MoveScaled(2,51,11,3)
'Move(14,357,77,21)
Text = ("Fax")
}
{ TextLabel6 TextLabel
MoveScaled(2,46,11,3)
'Move(14,322,77,21)
Text = ("Téléphone")
}
{ TextLabel7 TextLabel
MoveScaled(58,33,4,3)
'Move(406,231,28,21)
Text = ("Actif")
}
{ TextLabel8 TextLabel
MoveScaled(2,66,11,3)
'Move(14,462,77,21)
Text = ("Site marie")
}
{ TextLabel9 TextLabel
MoveScaled(2,61,11,3)
'Move(14,427,77,21)
Text = ("Repertoire")
}
{ TextLabel10 TextLabel
MoveScaled(39,47,11,3)
'Move(273,329,77,21)
Text = ("Responsable")
}
{ TextLabel11 TextLabel
MoveScaled(39,51,11,3)
'Move(273,357,77,21)
Text = ("Carte")
}
{ photo PictureBox
MoveScaled(71,5,38,24)
'Move(497,35,266,168)
ToolTip = ("Cliquer double\nsur le photo pour\npouvoir le changer")
Alignment = Align.Center
Border = Border.Etched
}
{ photo_ville PictureBox
MoveScaled(71,32,38,24)
'Move(497,224,266,168)
ToolTip = ("Cliquer double\nsur le photo pour\npouvoir le changer")
Alignment = Align.Center
Border = Border.Etched
}
{ TextLabel12 TextLabel
MoveScaled(71,1,11,3)
'Move(497,7,77,21)
Text = ("Photo")
}
{ TextLabel13 TextLabel
MoveScaled(71,29,16,3)
'Move(497,203,112,21)
Text = ("Photo Ville")
}
{ directeur ComboBox
MoveScaled(51,46,16,3)
'Move(357,322,112,21)
Text = ("")
}
{ chef_secteur ComboBox
MoveScaled(51,51,16,3)
'Move(357,357,112,21)
Text = ("")
}
{ ToolButton4 ToolButton TBs
Name = "ToolButton4"
MoveScaled(36,1,14,3)
'Move(252,7,98,21)
Background = Color.Background
Tag = "tel|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Téléphone")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton5 ToolButton TBs
Name = "ToolButton5"
MoveScaled(56,1,10,3)
'Move(392,7,70,21)
Background = Color.Background
Tag = "fax|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Fax")
Picture = Picture["icon:/16/redo"]
}
{ ToolButton3 ToolButton TBs
Name = "ToolButton3"
MoveScaled(3,1,10,3)
'Move(21,7,70,21)
Background = Color.Background
Tag = "nom|DESC"
ToolTip = ("Clique moi pour faire\nune tri sur la colonne")
Text = ("Nom")
Picture = Picture["icon:/16/redo"]
}
{ nom TextBox Stxt
Name = "nom"
MoveScaled(14,31,37,3)
'Move(98,217,259,21)
Text = ("")
}
{ rue TextBox Stxt
Name = "rue"
MoveScaled(14,36,37,3)
'Move(98,252,259,21)
Text = ("")
}
{ plz TextBox Stxt
Name = "plz"
MoveScaled(14,41,11,3)
'Move(98,287,77,21)
Text = ("")
}
{ ville TextBox Stxt
Name = "ville"
MoveScaled(26,41,25,3)
'Move(182,287,175,21)
Text = ("")
}
{ tel TextBox Stxt
Name = "tel"
MoveScaled(14,46,18,3)
'Move(98,322,126,21)
Text = ("")
}
{ fax TextBox Stxt
Name = "fax"
MoveScaled(14,51,18,3)
'Move(98,357,126,21)
Text = ("")
}
{ tcpip TextBox Stxt
Name = "tcpip"
MoveScaled(14,56,18,3)
'Move(98,392,126,21)
Text = ("")
}
{ repertoire TextBox Stxt
Name = "repertoire"
MoveScaled(14,61,31,3)
'Move(98,427,217,21)
Text = ("")
}
{ site_marie TextBox Stxt
Name = "site_marie"
MoveScaled(14,66,31,3)
'Move(98,462,217,21)
Text = ("")
}
{ actif CheckBox
MoveScaled(59,36,2,3)
'Move(413,252,14,21)
Text = ("CheckBox1")
}
{ Button1 Button
MoveScaled(97,81,11,3)
'Move(679,567,77,21)
Background = &H800000&
Foreground = &HFFFFBF&
ToolTip = ("Appuyer pour quitter le programme")
Text = ("Sortir")
}
{ Separator1 Separator
MoveScaled(36,46,1,13)
'Move(252,322,7,91)
}
{ TextLabel14 TextLabel
MoveScaled(2,71,10,9)
'Move(14,497,70,63)
Text = ("Territoire \n(Villes secteur \nagence)")
}
{ villes ListBox
MoveScaled(14,71,31,9)
'Move(98,497,217,63)
}
{ TextLabel15 TextLabel
MoveScaled(51,59,29,3)
'Move(357,413,203,21)
Text = ("Texte commerciale de l'agence")
}
{ textecom TextArea Stxt
Name = "textecom"
MoveScaled(51,62,58,18)
'Move(357,434,406,126)
Text = ("")
}
{ Nouveau Button
MoveScaled(51,81,12,3)
'Move(357,567,84,21)
Background = &H323C80&
Foreground = &HFFFFBF&
ToolTip = ("Vous pouvez enregistrée\nune nouvelle agence ici->")
Text = ("Nouveau")
}
{ SelVilles ToolButton
MoveScaled(33,81,12,3)
'Move(231,567,84,21)
Background = &HFFFF5F&
ToolTip = ("Cliquer pour ajouter\nau supprimer des\nvillages du territoir\nde cette agence")
Text = ("Changer")
Picture = Picture["Images/go-up.png"]
Border = True
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FormAgencesList.class
Type: application/x-java
Size: 9454 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20070330/082b999a/attachment-0001.bin>
More information about the User
mailing list