[Gambas-user] Creating a Table

Jim Ward zjimward at ...626...
Thu Mar 17 18:39:15 CET 2005


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




More information about the User mailing list