Using SQL to Report on Repository Data

Suppose you want to determine whether any two forms represented in the repository share a name. You can create a Visual Basic project to display those names that are common to two or more forms. One way to accomplish this is to do it with query logic in a Visual Basic module.

To use queries against the repository database, your Visual Basic module should follow these steps:

  1. Open the repository.

  2. Obtain an ODBC connection to the repository database.

  3. Run the SQL query to select the names shared by multiple forms.

  4. Display the results on a Visual Basic form.

Before you run this project, add a reference to the Microsoft Repository type library. You need this reference because the project calls Repository directly to open the repository. (Type library references are managed by Visual Basic through the References dialog box, accessible from the Project menu.)

For More Information Repository SQL Schema; MDO Model SQL Schema