[Gambas-user] Creating an Auto Increment Field

Eric Damron edamron at ...776...
Sat Feb 5 07:17:45 CET 2005


I'm writing a routen to create a database if it doesn't exist.  I need 
to make the primary key an auto increment integer (MySQL database)

I use the following to create an integer primary key:

  WITH hConnection
    hTable = .Tables.Add("CALL")
    hTable.Fields.Add("id", gb.Integer, 11)
    hTable.PrimaryKey = ["id"]
    hTable.Update 
  END WITH

But how do I make it an auto increment?  (Without Exec a SQL alter table 
statement later.)

Thanks




More information about the User mailing list