How to Use the Attrib Command to Hide a FoxPro Database

Last reviewed: June 27, 1995
Article ID: Q124126
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.