_Field.Add (gb.mysql)
Sub Add ( Field As String, DataType As String [ , AceptNull? As Boolean, DefaultValue As Variant, AutoIncrement? As Boolean, OnUpdate As String, Comment As String ] )
Enregistre l'information pour un champ, plus tard, cette information sera utilisée pour créer une table.
Quand la table est créée l'information de champ est effacée.
Exemples
Dim hCon As New Connection
With hCon
.Type = "mysql"
.Port = "3306"
.Host = "localhost"
.User = "root"
.Password = "mypass"
.Name = "Gambas"
.Open()
End With
hCon.MySQL.Field.Add("actor_id", hCon.MySQL.DataTypes.UnsignedSmallInt, False,, True)
Partie de la commande MySQL : `actor_id` smallint(5) unsigned NOT NULL auto_increment,
Dim hCon As New Connection
With hCon
.Type = "mysql"
.Port = "3306"
.Host = "localhost"
.User = "root"
.Password = "mypass"
.Name = "Gambas"
.Open()
End With
hCon.MySQL.Field.Add("last_update", hCon.MySQL.DataTypes.TimeStamp, False, "CURRENT_TIMESTAMP",, "CURRENT_TIMESTAMP")
Partie de la commande MySQL : `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,