--- title: "DateCreated and DateModified Properties Example (VB) | Microsoft Docs" ms.prod: sql ms.prod_service: connectivity ms.technology: connectivity ms.custom: "" ms.date: "01/19/2017" ms.reviewer: "" ms.topic: conceptual dev_langs: - "VB" helpviewer_keywords: - "DateCreated property [ADOX], Visual Basic example" - "DateModified property [ADOX], Visual Basic example" ms.assetid: d608ea35-6e68-402f-8184-a5041e408678 author: MightyPen ms.author: genemi --- # DateCreated and DateModified Properties Example (VB) This example demonstrates the [DateCreated](../../../ado/reference/adox-api/datecreated-property-adox.md) and [DateModified](../../../ado/reference/adox-api/datemodified-property-adox.md) properties by adding a new [Column](../../../ado/reference/adox-api/column-object-adox.md) to an existing [Table](../../../ado/reference/adox-api/table-object-adox.md) and by creating a new **Table**. The DateOutput procedure is required for this example to run. ``` ' BeginDateCreatedVB Sub Main() On Error GoTo DateCreatedXError Dim cat As New ADOX.Catalog Dim tblEmployees As ADOX.Table Dim tblNewTable As ADOX.Table ' Connect to the catalog. cat.ActiveConnection = "Provider='Microsoft.Jet.OLEDB.4.0';" & _ "Data Source='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 'Clean up. Set cat.ActiveConnection = Nothing Set cat = Nothing Exit Sub DateCreatedXError: Set cat = Nothing If Err <> 0 Then MsgBox Err.Source & "-->" & Err.Description, , "Error" End If End Sub Sub DateOutput(strTemp As String, tblTemp As ADOX.Table) ' Print DateCreated and DateModified information about ' specified Table object. Debug.Print strTemp Debug.Print " Table: " & tblTemp.Name Debug.Print " DateCreated = " & tblTemp.DateCreated Debug.Print " DateModified = " & tblTemp.DateModified Debug.Print End Sub ' EndDateCreatedVB ``` ## See Also [DateCreated Property (ADOX)](../../../ado/reference/adox-api/datecreated-property-adox.md) [DateModified Property (ADOX)](../../../ado/reference/adox-api/datemodified-property-adox.md) [Procedure Object (ADOX)](../../../ado/reference/adox-api/procedure-object-adox.md) [Procedures Collection (ADOX)](../../../ado/reference/adox-api/procedures-collection-adox.md) [View Object (ADOX)](../../../ado/reference/adox-api/view-object-adox.md) [Views Collection (ADOX)](../../../ado/reference/adox-api/views-collection-adox.md)