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

Cut the links between tables and its database

Status
Not open for further replies.

omegabeta

Programmer
Aug 20, 2003
148
RO
Hi,
How can I cut the links between tables and its database using VFP code?
I'm using some tables belonging to a database in another application(COPY FILE.. TO). When I'm trying to use SELECT ...FROM t1,t2 I get the following message:

"MyDatabase.dbc
The database for table t1.dbf could not be opened ...or delete the link"
After delete, I get the message "File must be opened exclusively". But as I said the error appears at SELECT.. FROM command within my program.
How can I solve the problem without copying the .dbc file?

Thanks in advance.
 


How can I solve the problem without copying the .dbc file?

Not possible, since the DBC files holds the link information.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
omegabeta,
While Mike is technically correct, you could "fix" the .DBF header to kill the backlink information (using LLIO is one method). HOWEVER, since the DBC holds all of the "extended" information about a table, you may not be able to use it like you want. Things like long field names, default values, validation rules on both fields and records (including any referential integrity), comments, etc. will all be lost without the .DBC (and .DBT).

Rick
 
You can try changing the COPY TO statement so it includes a TYPE FOX2X statement. I believe that will make it a FREE TABLE.

COPY Fields f1, f2 to myTable TYPE FOX2X



Jim Osieczonek
Delta Business Group, LLC
 
Hi omegabeta,

USE Mytable && also opens the database
COPY STRUCTURE TO NewTable && free table, but empty

you can also:
CLOSE DATABASES
COPY TO NewTable && also a free table, not empty

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top