[Gambas-user] create tables
nigel at ...38...
nigel at ...38...
Wed Jun 22 11:37:12 CEST 2005
Instead of using the line
.Host = location &/ "Paquito"
change it to
.Name = "Paquito"
Regards
Nigel
> Message date : Jun 21 2005, 11:06 PM
> From : "PaquitoSoft" <cloroetilo at ...626...>
> To : gambas-user at lists.sourceforge.net
> Copy to :
> Subject : Re: [Gambas-user] create tables
>
> I had done so. I forgot to paste that line.
> I actually create an instance of Connection. In fact, it woludn't be
> possible to create the database without it.
>
>
> El mié, 22-06-2005 a las 01:23 +0800, Werner escribió:
> > PaquitoSoft wrote:
> >
> > >Hi all!
> > >
> > >I'm using Gambas 1.9.8 under Debian/GNU Linux
> > >
> > >I want my application to create a database the first time it is run.
> > >So I check if it already exists and I create it if not.
> > >Until here everything is ok, but the problem arraives when i try to
> > >create the tables for the database.
> > >This is how I'm trying:
> > >
> > >DIM conexion as Connection
> > >DIM tabla as Table
> > >DIM location as String
> > >
> > >WITH conexion
> > > .Type = "sqlite"
> > > .Host = location
> > > .Open()
> > >
> > > IF .Databases.Exist("Paquito") THEN
> > > PRINT "Database already exists"
> > > ELSE
> > > .Databases.Add("Paquito")
> > > PRINT "New Database created"
> > > END IF
> > >
> > > .Close()
> > > .Host = location &/ "Paquito"
> > > .Open()
> > >
> > > tabla = .Tables.Add("preferencias")
> > > tabla.Fields.Add("idioma", GB.String, 5)
> > > tabla.Fields.Add("interfaz", GB.String, 5)
> > > tabla.Fields.Add("maxUp", GB.Integer)
> > > tabla.Fields.Add("maxDown", GB.Integer)
> > > tabla.Update()
> > > .Close()
> > >END WITH
> > >
> > >location is a String containing the directory where I will store the
> > >database.
> > >After I run this code I get a new Database in that folder with the name
> > >I put and, of course, is a sqlite sigle-fil database.
> > >The problem is that no table is created within the database, so...
> > >What am I doing wrong??
> > >
> > >Thank you all guys! this mailing list is great
> > >
> > >
> > >
> > You migth want to try
> >
> > DIM conexion as NEW Connection 'to create an instance
> >
> > Werner
> >
> >
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> > from IBM. Find simple to follow Roadmaps, straightforward articles,
> > informative Webcasts and more! Get everything you need to get up to
> > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> --
> El tiempo es un gran profesor. Desafortunadamente, mata a todos sus
> alumnos.
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
--
Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/
This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm
More information about the User
mailing list