[Gambas-user] Need help with database.

Fabien Bodard abidoo.too at ...11...
Mon May 24 19:54:51 CEST 2004


Le dimanche 23 Mai 2004 23:25, Benoit Minisini a écrit :
> On Sunday 23 May 2004 23:07, Fabien Bodard wrote:
> > Le dimanche 23 Mai 2004 22:56, Benoit Minisini a écrit :
> > > On Sunday 23 May 2004 22:48, Fabien Bodard wrote:
> > > > I've another problem... The table is create in then system table of
> > > > MySQL.... Why ?
> > >
> > > What ??
> >
> > <fr>ben quand je fait
> >
> > CurTable.Update la table n'est pas ajouté a ma base vitis mais a la base
> > system de mysql
> >
> > Je t'envois mon code
> >
> > merci de ton aide
> >
> > Fabien
>
> Did you connect to your database after having created it ?


IF NOT Con.Database.Exist("vitis") THEN con.Database.Create("vitis")
  Con.Database.Find("vitis")

----->> ***********  yes ! here ! ******************************************

  IF NOT Con.Tables.Exist("parcellaire") THEN 
      CurTable = Con.Tables.Create("parcellaire")
  
  CurTable.Field.Create("idparc", gb.Integer,,0)
  CurTable.Field.Create("proprietaire", gb.String, 30," ")
  CurTable.Field.Create("fv", gb.String, 3," ")
  CurTable.Field.Create("idcommune", gb.Integer, ,0)
  'CurTable.Field.Create("idcommune", gb.String, 30," ")
  CurTable.Field.Create("lieudit", gb.String, 30," ")
  CurTable.Field.Create("section", gb.String, 3," ")
  CurTable.Field.Create("cadastre", gb.integer,, 0 )
  CurTable.Field.Create("Surface", gb.Float,, 0)
  CurTable.Field.Create("nom", gb.string, 30, 0)
  CurTable.Field.Create("idCepage", gb.Integer,, 0)
  CurTable.Field.Create("Couleur", gb.string, 15, 0)
  CurTable.Field.Create("dateplantation", gb.Date,, "1/01/2000")
  CurTable.Field.Create("surfaceplante", gb.Float,, 0)
  CurTable.Field.Create("idpg", gb.Integer,, 0)
  CurTable.Field.Create("entrerang", gb.float,, 0)
  CurTable.Field.Create("intercep", gb.float,, 0)
  CurTable.Field.Create("abouture", gb.string, 30, 0)
  CurTable.PrimaryKey = ["idparc"]
  con.Tables["parcellaire"] = CurTable
  con.Tables["parcellaire"].Update 
  FOR EACH Curtable.Field
   PRINT Curtable.Field.name  
  NEXT



i use the connection.database.Find   function to select my database... do i've 
forgoten something ?


Fabien




More information about the User mailing list