[Gambas-user] Creating a Table

nigel at ...38... nigel at ...38...
Fri Mar 18 17:28:15 CET 2005


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:
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050318/fe932b3f/attachment.html>


More information about the User mailing list