Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding what folder a user has selected after : OPEN DATABASE ?

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I have an application where I invite the user to open a database :

OPEN DATABASE ?

This command displays a window “Select Database name” and the user may navigate to the folder containing the .dbc file.

I then open several tables within that database, and that is fine. However I would also like to open another specific free table, which is in the same folder as the database, but is not part of the database.

How can I find the name of the folder which he has just navigated to successfully? I would prefer not to display another folder selection window, because I feel that I ought to know which folder he is talking about.

(The folder does not appear to be HOME() or CURDIR())

On a related point, how can I find the name of the current DEFAULT folder? I can use SET DEFAULT TO to set it, but is there a command or function to find what it is?
 
Simple: DBC() gibes you full file name of the currently active database, like DBF() gives the file name.

I just tested, OPEN DATABASE ? does also activate the newly opened database, so DBC() directly after OPEN DATABASE ? is it. Or for the path JUSTPATH(DBC())

I would nevertheless suggest not to allow such direct database choice, rather use GETFILE("dbc"), then double check, if the user should be able to open that database and you also have the full path to the database even before opening it.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top