Retrieve Table Names from a Database using ADOX

Category:
Database
Type:
Snippets
Difficulty:
Intermediate
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic 6

More information:
This example uses ADOX (the new extensions to ADO for Database Definition Language and security) to retrieve the table names from a database. As it's written, you have to pass the function a valid ADO connection string (though you can easily modify it, for example, to require a ADODB.connection). This code has been tested with Access and SQL Server 7.0. Because ADOX has not yet been implemented by all providers, I don't know what other databases it will work with.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: