Knowledge Base

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

Article ID: 134978

Article Last Modified on 2/15/2000


APPLIES TO


This article was previously published under Q134978

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 query words: 3.00 VFoxWin

Keywords: KB134978