Microsoft KB Archive/138662

{| = How to Start FoxPro 2.6 Catalog Manager with Specific Catalog =
 * width="100%"|

ID: Q138662

The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.6a
 * Microsoft FoxPro for Macintosh, version 2.6a
 * Microsoft FoxPro for MS-DOS, version 2.6a

SUMMARY
The FoxPro resource file can be modified to cause the FoxPro 2.6 Catalog Manager to start with a specific catalog. By design, the FoxPro 2.6 Catalog Manager starts with the catalog that was active when the Catalog Manager was last closed.

Upon startup, the FoxPro 2.6 Catalog Manager gets the last-used catalog name from the Foxuser resource file. The record is identified by the fields Id = "CATALOG" and Name = "Catalog Name." The Data field holds the path and name of the most recently used catalog. The Data field can be modified either directly or programatically. This article describes both ways.

Directly Changing the Default Catalog
Edit the Foxuser.dbf file putting the path and name of the catalog in the data field. Then change the Readonly field's value to true (.T.). This can be done as follows:

1. If you are running the catalog manager, on the File menu, click Command

window to return to the Command window. 2. In the Command window, type the following commands: SET RESOURCE OFF USE SYS(2005) BROWSE FOR Id="CATALOG" 3. Press the TAB key to move to the data field for the record where the Name field contains Catalog Name. To edit the memo, double-click Memo or press CTRL+PGDN. 4. Type in the path and name of the desired catalog, including the .fpc extension. Press CTRL+W to save changes to the memo. 5. In the field named readonly, change the value to true (.T.). This will keep FoxPro from changing this information in future sessions. 6. Press CTRL+W to save changes to the Foxuser.dbf file. 7. Tell FoxPro to again use the resource file, by issuing the following

commands in the command window:

USE SET RESOURCE ON To confirm the results, on the File menu, click Catalog Manager, or quit and restart FoxPro.

Programatically Setting the Default Catalog
Setting the default catalog programatically could allow more flexibility. This can be done by calling a program from the Config.fp(w/m) file to reset the catalog specified in the Data field. This program will replace the catalog name in the Data field with the catalog specified in the called program. The following example uses a catalog file called Mycat.fpc located in the C:\Fpw directory.

1. Create the following program:

*** defltcat.prg

SET RESOURCE OFF              && Turn off resource file USE SYS(2005)                 && Open the resource file LOCATE FOR id="CATALOG" AND ; name= "Catalog Name"       && Find the catalog record REPLACE data WITH "c:\fpw26\mycat.fpc"  && Store catalog's path & name USE                                     && Close resource file SET RESOURCE ON                         && Turn on resource file

* End of defltcat.prg 2. Call the defltcat program on startup by adding the following line to the Config.fp(w/m) file:

COMMAND = DO c:\fpw26\defltcat

If the line "CATMAN=ON" is not in the file, add it. 3. Confirm the results by quitting FoxPro and restarting. Additional reference words: 2.60a FoxWin catman catalog manager KBCategory: kbother kbhowto KBSubcategory: FxotherGeneral
 * }