Article ID: 210398 - Last Review: October 11, 2006 - Revision: 2.2 ACC2000: Sample Code to Check for Table or Query in a DatabaseThis article was previously published under Q210398 Advanced: Requires expert coding, interoperability, and multiuser skills.
SUMMARY
This article contains a sample user-defined function named IsTableQuery()
that you can use to determine whether a table or a query exists in a
database. The sample function uses the TableDefs and QueryDefs Data Access Objects (DAO) collections.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected. The following example demonstrates how to use the sample user-defined function IsTableQuery() to determine whether a table or query exists in a database:
REFERENCESFor more information about the TableDefs collection, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type TableDefs collection in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For more information about the QueryDefs collection, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type QueryDefs collection in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
