'Purpose: List the tables (and optionally their fields) using ADOX.ĭim cat As New ADOX.Catalog 'Root object of ADOX.ĭim tbl As ADOX.Table 'Each Table in Tables.ĭim col As ADOX.Column 'Each Column in the Table. Set cat.ActiveConnection = CurrentProject.ConnectionĬat.Tables(strTable).Columns(strAutoNum).Properties("Seed") = lngIDįunction ShowAllTables(Optional bShowFieldsToo As Boolean) 'Purpose: Set the Seed of an AutoNumber using ADOX. To reset the seed for all tables in a database, see:įixing AutoNumbers when Access assigns negatives or duplicatesįunction SetSeed(strTable As String, strAutoNum As String, lngID As Long) As Boolean Read the Seed of the AutoNumber of a table
ADOX CAMERA VALUE HOW TO
Show how to add fields to a table, and delete themĭelete all records from the table, and reset the AutoNumber Show the columns in a table, and optionally their properties List the tables (and optionally their fields) There is no explanation of the code beyond in-line comments, and no error handling in most examples. See the field type reference for a comparison of the field types in ADOX compared to the Access interface and other libraries.
ADOX CAMERA VALUE UPDATE
The ADOX library is less stable, and more subject to version problems, so if you strike problems with the code in this page, an MDAC update might address the issue for you. But there are some things DAO cannot do, such as setting the Seed of an AutoNumber field. DAO is purpose-designed for Access, and exposes properties the other libraries don't. In general, the DAO library is better than ADOX. Microsoft ADO Ext x.x for DDL and Security To use this library, open the code window, choose References on the Tools menu, and check the box beside: This page is a reference for developers, demonstrating how to use the ADOX library to programmatically create, delete, modify, and list the objects in Access - the tables, fields, indexes, and relations, queries, and databases - and read or set their properties.ĪDOX is an extension to the ADO library, exposing the catalog of database objects. Microsoft Access tips: ADO Programming Code Examples Microsoft Access: ADOX Programming Code Examples