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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using other folders 1

Status
Not open for further replies.

Jackhag

Programmer
Mar 5, 2003
6
US
Being a relatively novice programmer, I continue to have problems when databases are not in the home folder "c:\program files\Microsoft Visual FoxPro8\Visual FoxPro 8.0 Professional - English". It remains difficult to open those databases or create new ones programactically. What's the best way to do it?
 
This sounds like a security problem.

Most of the folders on most Windows machines are locked down' these days to help minimise virus problems.

You can probably open databases on your desktop, and anywhere else within your own 'My Documents' structure.

Also, you will probably find that if you have additional drives (D: or network drives) that you have full access to these.

Watch out for folders with spaces in their names - you may need to enclose them in quotes and use some kind of character expansion to access them...

Code:
use ("c:\my documents\my database folder\myTable")

Good luck.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
First - you are most likely saving data tables, which could or could not be contained within a database.

Could you be a little more specific when you say - "It remains difficult to open those databases or create new ones programactically."

Difficult how?

They are saved somewhere else and you don't know where?
They throw an error message indicating some specific problem?
Etc.

Also how are you trying to create these data tables programatically?
What code are you using?
Are you specifying the path within the sting?
Etc.

With a little more info we can most likely help you out.

Good Luck,
JRB-Bldr
 
Here are a couple of basic commands that may assist you.

Consider changing your working directory to a project folder using "CD xxx"; Setting a path using "SET PATH TO xxx ADDITIVE"; opening a database using "OPEN DATABASE xxx"; opening a table using "USE xxx IN 0", selecting the table using "SELECT xxx"; and finally browsing the records using "BROWSE". There are options for all of these commands, which you can get help by using F1.

For example, if you have created project in the following folder "C:\My VFP Projects\Project 1", a "Data" subfolder, and a database called Data1.dbc within that data folder. From the Command Window (Ctrl+F2), try out these commands.

CD "C:\My VFP Projects\Project 1"
SET PATH TO Data ADDITIVE
OPEN DATABASE Data1
USE Data1!Table1 in 0
SELECT Table1
BROWSE

Best of luck,
Bob Ethridge
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top