_DataBase.Delete (gb.mysql)

Sub Delete ( [ Database As String, IfExists As Boolean ] )

Drops a database.

Database: Is the name of the database. If isn't given, then the current database is used.
IfExists: If set to true, will drops the database only if exists, otherwise will raise an error.

Examples

Dim hCon As New Connection

With hCon
  .Type = "mysql"
  .Port = "3306"
  .Host = "localhost"
  .User = "root"
  .Password = "mypass"
  .Name = "Gambas"
  .Open()
End With

hCon.MySQL.DataBase.Delete("Gambas", True)

MySQL statement: DROP DATABASE IF EXISTS `Gambas`

Dim hCon As New Connection

With hCon
  .Type = "mysql"
  .Port = "3306"
  .Host = "localhost"
  .User = "root"
  .Password = "mypass"
  .Name = "Gambas"
  .Open()
End With

hCon.MySQL.DataBase.Delete("Gambas", False)

MySQL statement: DROP DATABASE `Gambas`