Delete Method Example 2 (Professional Edition Only)

This example finds and then deletes a record.

Dim Db As Database, MyTable As Table
Set Db = OpenDatabase("BIBLIO.MDB")
Set MyTable = Db.OpenTable("Publishers")
MyTable.FindFirst "PubNum = 9"            ' Find a specific record.
If Not MyTable.NoMatch Then               ' Check if record found.
  MyTable.Delete                          ' Delete record.
End If

This example adds and then deletes an Index from a TableDef.

Dim MyDB As Database, MyTableDef As TableDef, MyIndex As New Index
Set MyDB = OpenDatabase("BIBLIO.MDB")          ' Open the database.
Set MyTableDef = MyDB.TableDefs("Publishers")  ' Set the TableDef.
MyIndex.Name = "Author Name"                   ' Set Index properties.
MyIndex.Fields = "Author"
MyTableDef.Indexes.Append MyIndex              ' Add Index to TableDef.
MyTableDef.Indexes.Delete "Author Name"        ' Delete the Index.