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

Foxpro Database containership 1

Status
Not open for further replies.

ahaws

Programmer
Nov 28, 2001
355
US
Hi. I am alittle new to VFP 6.0, and was editing a program that wasnt written by me. I have noticed that he used a .dbc, and stored it in the "live" production directory. When the program is run from that directory, it uses the tables within the .dbc fine. My problem, is that in my workarea, I DO NOT want to mess with the live data...so how do I change the database container to look at the sample .dbf's in my work area(the would have the same name)? I did some stepping through, and found that when I was running it in the workarea, it was definitely looking at the live data...no good! I changed all kinds of things testing it...what a nightmare.
So basically I need to know how to point to the files in my workarea...or do I need to create another .dbc?
I tried to create a different .dbc and when I tried to place the .dbf's inside, it said they were already part of a container...getting nowhere..I appreciate all help I can get.
Thanks
Angie
 
A Database (DBC) is just a table that has links to the tables it contains (amoung other things). Also each table in the DBC has a backlink that points to this DBC. (This is why a table can only belong to one Database.)

The best way to create an alternate Database, is to copy the Database and all the tables (with supporting index and memo files) to a separate directory. Then you can clear out the data that you don't want in this data set.

In the program, you can just check some system setting (or information in a free table) to open the "proper" Database to work with. Unfortunately, even in VFP 7.0, we don't have the option to "alias" a Database like we can a table, so you can store two databases with the same name in the same directory.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top