ADOX 2.7

Columns and Tables Append Methods, Name Property Example (VB)

The following code demonstrates how to create a new table.

' BeginCreateTableVB
Sub CreateTable()

   Dim tbl As New Table
   Dim cat As New ADOX.Catalog

'Open the catalog.
   ' Open the Catalog.
   cat.ActiveConnection = _
      "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=c:\Program Files\Microsoft Office\" & _
      "Office\Samples\Northwind.mdb;"

   tbl.Name = "MyTable"
   tbl.Columns.Append "Column1", adInteger
   tbl.Columns.Append "Column2", adInteger
   tbl.Columns.Append "Column3", adVarWChar, 50
   cat.Tables.Append tbl

End Sub
' EndCreateTableVB

See Also

Append Method (Columns) | Append Method (Tables) | Column Object | Columns Collection | Name Property | Table Object | Tables Collection

© 1998-2001 Microsoft Corporation. All rights reserved.