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

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


Last Reviewed: August 16, 1995
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.