This example demonstrates the DateCreated and DateModified properties by adding a new Column to an existing Table and by creating a new Table. The DateOutput procedure is required for this example to run.
' BeginDateCreatedVB Sub DateCreatedX() Dim cat As New ADOX.Catalog Dim tblEmployees As ADOX.Table Dim tblNewTable As ADOX.Table ' Connect the catalog. cat.ActiveConnection = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=c:\Program Files\" & _ "Microsoft Office\Office\Samples\Northwind.mdb;" With cat Set tblEmployees = .Tables("Employees") ' Print current information about the Employees table. DateOutput "Current properties", tblEmployees ' Create and append column to the Employees table. tblEmployees.Columns.Append "NewColumn", adInteger .Tables.Refresh ' Print new information about the Employees table. DateOutput "After creating a new column", tblEmployees ' Delete new column because this is a demonstration. tblEmployees.Columns.Delete "NewColumn" ' Create and append new Table object to the Northwind database. Set tblNewTable = New ADOX.Table tblNewTable.Name = "NewTable" tblNewTable.Columns.Append "NewColumn", adInteger .Tables.Append tblNewTable .Tables.Refresh ' Print information about the new Table object. DateOutput "After creating a new table", .Tables("NewTable") ' Delete new Table object because this is a demonstration. .Tables.Delete tblNewTable.Name End With End Sub ' EndDateCreatedVB
DateCreated Property | DateModified Property | Procedure Object | Procedures Collection | View Object | Views Collection
© 1998-2001 Microsoft Corporation. All rights reserved.