[Gambas-user] Creating a Table

Jim Ward zjimward at ...626...
Fri Mar 18 17:34:44 CET 2005


I was looking at the examples and it took me a bit to notice that they
didn't set the .name until after they did this check. Thanks so much
for your help.


On Fri, 18 Mar 2005 17:28:15 +0100 (CET),
nigel at ...38... <nigel at ...38...>
wrote:
> 
> 
> Jim, 
> 
> Take a look at the examples for the database.  There you will find: 
> 
> Do not set the database name but check it's existance: 
> 
> $hConn.Open 
> 
> IF NOT $hConn.Databases.Exist("database") THEN 
> 
>     $hConn.Databases.Add("database") 
> 
> ENDIF 
> 
> Nigel
> 
> 
> 
> 
>  
> > Message date : Mar 17 2005, 05:41 PM
> > From : "Jim Ward" 
> > To : "gambas list" 
> > Copy to : 
> > Subject : [Gambas-user] Creating a Table
> 
> > In looking through the gb.db documentation I was trying to find a way
> > to create a brand new database.
> > 
> > I did the following:
> > 
> > DIM db AS NEW Connection
> > DIM rData AS Result
> > DIM sQuery AS String
> > 
> > db.Type = "mysql"
> > db.Host = "localhost"
> > db.Login = "root"
> > db.Password = ""
> > db.Name = "jdwdb"
> > 
> > TRY db.Open
> > 
> > IF ERROR THEN
> > PRINT "Cannot Open Database. Error = "; Error.Text
> > db.Create("jdwdb")
> > ENDIF
> > 
> > db.Close
> > 
> > I received the message: Connection not opened for the db.Create line
> > and therefore assume that this is for creating tables, not databases.
> > The big question is how do I go about creating a brand new database?
> > 
> > Thanks for any help.
> > 
> > Regards,
> > jim
> > 
> > 
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > 
> > 
> 
> ________________________________
> Whatever you Wanadoo
> 
> This email has been checked for most known viruses - find out more here




More information about the User mailing list