How to Use the Attrib Command to Hide a FoxPro Database

ID: Q124126

The information in this article applies to:

SUMMARY

FoxPro does not have a way to add security restrictions to a .DBF file. However, you can keep users from seeing databases in the File Open dialog by marking the .DBF file as hidden. Use the following MS-DOS command:

   ATTRIB +H <filename>

Or use the File Manager Properties selection. File Manager will still find the file if File Search is done. You should also hide the .FPT and .CDX files.

MORE INFORMATION

The table (.DBF file) can still be opened by issuing the USE command within FoxPro even though the file is hidden.

NOTE: When a database is hidden this way and the SQL SELECT command is issued on the hidden .DBF file, the SQL SELECT command cannot find the .DBF file. A dialog box will appear on the screen asking you to select a table. Therefore, if you use MS-DOS ATTRIB command to hide the .DBF file, you need to use the USE command to open it before using the SQL SELECT command.

For more information about encrypting FoxPro files, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q115476
   TITLE     : How to Encrypt FoxPro .DBF Files

Additional reference words: FoxWin 2.60a KBCategory: kbprg KBSubcategory: FxprgGeneral

Last Reviewed: June 27, 1995