[Gambas-user] Maybe a bug in how Gambas manages open DB connections

Kari Laine klaine8 at ...626...
Sat Sep 6 00:28:35 CEST 2008


>
> Ops.... I forgot the version: 2.8.1, but got the same error with
> previous versions 2.8 and, if I remember correctly, 2.7.
>
> Hi,

with Gambas 2.7 I tested following and got no errors. Maybe you could post
more complete program others could test with.

' Gambas class file
PRIVATE Connessione AS NEW Connection
PRIVATE Risultato AS Result

PUBLIC SUB Form_Open()
 WITH Connessione
   .Name = "laskutus"
   .Type = "mysql"
   .User = "root"
   .Password = ""
   .Host = "localhost"
   .Open
 END WITH
END

PUBLIC SUB Button1_Click()
DIM Connessione2 AS NEW Connection
DIM Risultato2 AS Result

 Risultato = Connessione.Find("asiakas", "id=&1", Trim(TextBox1.Text))
' IF Risultato.Available = FALSE THEN
'   RETURN
' END IF

TextBox2.Text = Risultato!nimi

 WITH Connessione2
   .Name = "laskutus"
   .Type = "mysql"
   .User = "root"
   .Password = ""
   .Host = "localhost"
   .Open
 END WITH

Risultato2 = Connessione2.Find("yritys", "id=&1", Trim(TextBox1.Text))

TextBox3.Text = Risultato2!nimi

Risultato.MoveFirst

TextBox4.text = Risultato!nimi
END


Best Regards
Kari Laine



More information about the User mailing list