How to Extract the Full Path of a Table in Database Container

Last reviewed: August 16, 1995
Article ID: Q134978
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

The DBF() function returns the full path of a table that is currently open. Using the FULLPATH() and DBGETPROP() functions, the full path to a table in a database can be determined without opening the table because the relative path of the table to the location of the database is stored in the database.

MORE INFORMATION

The following commands display the full path of the Customer table in the Testdata database. In this example, the table is in the same directory as the database:

   OPEN DATABASE SYS(2004)+'SAMPLES\DATA\TESTDATA'
   ? FULLPATH( DBGETPROP( 'CUSTOMER' , 'TABLE' , 'PATH' ) , DBC() )

Use the following commands to create a table in a different directory from the database, and then obtain the path of the table using the functions described.

   SET DEFAULT TO SYS(2004)+'SAMPLES\MAINSAMP'
   CREATE DATABASE test
   CREATE TABLE data\testtbl (field1 C (50))
   CLOSE ALL
   OPEN DATABASE test
   ? FULLPATH( DBGETPROP( 'TESTTBL' , 'TABLE' , 'PATH' ) , DBC() )


Additional reference words: 3.00 VFoxWin
KBCategory: kbtool kbcode
KBSubcategory: FxtoolDbtabledes


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: August 16, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.