MODIFY QUERY Command
Opens the Query designer so you can modify or create a query.
Specifies the file name for the query. If you don't specify an extension for the file name, Visual FoxPro automatically assigns a .qpr extension.
Displays the Open dialog box from which you can choose an existing query or enter the name of a new query to create.
- WINDOW WindowName1
Specifies a window whose characteristics the Query Designer takes on. For example, if the window is created with the FLOAT option of DEFINE WINDOW, the Query Designer can be moved. The window need not be active or visible, but it must be defined.
- IN SCREEN
Explicitly opens the Query Designer in the main Visual FoxPro window, after it has been placed in a parent window. The Query Designer is placed in a parent window by including the IN WINDOW clause.
Continues program execution after the Query Designer is opened. The program doesn't wait for the Query Designer to be closed, but continues execution on the program line immediately following the line that contains MODIFY QUERY NOWAIT. If you omit NOWAIT when MODIFY QUERY is issued in a program, the Query Designer is opened and program execution pauses until the Query Designer is closed.
NOWAIT is effective only from within a program. It has no effect on MODIFY QUERY when issued from the Command window.
Leaves the Query Designer open after another window is activated. If you omit SAVE, the Query Designer is closed when another window is activated. Including SAVE has no effect when issued from the Command window.
- AS nCodePage
Specifies the code page of the query. Include AS nCodePage if the query was created with a code page other than the current Visual FoxPro code page. When the query is opened, Visual FoxPro automatically converts the query to the current Visual FoxPro code page. You can use GETCP( ) for nCodePage to display the Code Page dialog box, making it possible for you to specify a code page for the query.
The query is saved in its original code page when it is closed.
If you omit the AS nCodePage clause or nCodePage is 0, the query is not converted to the current Visual FoxPro code page. If you specify a value for nCodePage that is not supported, Visual FoxPro generates an error message.
In Visual FoxPro, queries can be added to a project, and you can specify the query's code page from within the Project Container. The Project Container keeps track of the query's code page. However, if you use MODIFY QUERY to open a query outside of the Project Container, you should include AS nCodePage to specify the query's code page.
For more information about creating queries, see.
Issuing MODIFY QUERY without any arguments displays the Open dialog box. If you choose New from this dialog box, the name QUERY1 is assigned to the query. You can save the query with a different name when you exit the Query Designer.
After you have created a query, the query is stored as a Visual FoxPro program file with a .qpr extension. You can execute a query program with DO, but you must include the .qpr extension with the query file name.