The Project Explorer provides a graphical means of managing the queries in your database project. By double-clicking, dragging and dropping, and using the right-click features, you can open, create, edit, and execute your queries.
Note In Microsoft Visual C++®, the Project Explorer is called FileView. From FileView, you can manage queries in much the same way as you can in the Project Explorer. For more information, see FileView in the Visual C++ documentation.
For details about using the Microsoft Visual Database Tools with database projects, see Working with Database Projects.
If you are working in a database project, you can perform the following tasks from the Project Explorer:
Note This drag-and-drop feature is not available in Microsoft® Visual Basic®. You can, however, paste the SQL statement into your code in a Visual Basic project to set the SQL property of a Remote Data Objects (RDO) Command object.
To add a query in the Project Explorer
Tip You can also right-click the project name, and then select Add Item to open the Add Item dialog box.
The Query Designer opens. For details about creating the query, see Creating Queries.
After creating the query in the Query Designer, you can save it. When you save a query:
To save a query
The Query Designer saves the SQL statement in a file, along with the window layout and any parameter information you have specified. By default, the query is saved in the project directory (the directory you specified when you created the database project), but you can specify any location available to your computer.
Note Queries are not stored as part of the database that you are querying. Instead, they are stored as stand-alone files on your computer or on the network you are connected to.
After creating a query, you can run it or open it again for further editing. If you no longer need a query, you can also delete it from the project.
To run, edit, or delete a query in the Project Explorer
To | Choose |
Edit the query | Design |
Run the query | Open (or double-click the name of the query) |
Delete the query | Delete |
Rename the query | Rename |