Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
COPY TO is the solution and doesn't drop off long field names, if you use the DATABASE clause:
Cd Getenv("TEMP")
*Close Tables all
Close Databases All
Set Safety Off
* some directory preparations
If !Directory("tablecopytest")
Mkdir tablecopytest
Endif
Cd tablecopytest
If !Directory("original")
Mkdir original
Endif
If !Directory("copy")
Mkdir Copy
Endif
Cd original
Erase *.*
Cd ..\Copy
Erase *.*
Cd..
* create two identical DBCs by creating one of them and the other by a full copy:
Local lcDBC
lcDBC = ".\original\tablecopydbc"+Sys(2015)
Create Database (lcDBC)
Create Table .\original\copytest1 (iID Int Autoinc, cSomedatafield c(10), Primary Key iID Tag pix)
Close Tables All
Close Databases All
Copy File .\original\*.* To .\Copy\*.*
* Now, create a new table in the original DBC:
Open Database (lcDBC)
Create Table .\original\copytest2 (iID Int Autoinc, copytest1ID Int, Primary Key iID Tag pix,;
foreign Key copytest1ID Tag ct1ix References copytest1 Tag pix)
Close Databases All
* And now only copy over the dbc files and the new table files
* (notice lcDBC only has the stem name of the database without file extensions)
* 1. copy dbc
Copy File (lcDBC+".*") To .\Copy\*.*
* 2. copy new table
Copy File .\original\copytest2.* To .\Copy\*.*
OPEN DATABASE C:\pathtoabc\ABC.dbc
OPEN DATABASE C:\pathtoxyz\XYZ.dbc
USE ABC!clients
COPY TO C:\pathtoxyz\clients.dbf DATABASE XYZ WITH CDX
SELECT * ;
FROM OldFolder\Customer ;
INTO TABLE NewFolder\Customer
SET DATABASE TO NewDatabase
ADD TABLE NewFolder\Customer
Tamar said:... use a query and then ADD TABLE ...
Mike Lewis said:By the way, I said earlier "there is no easy way of renaming the new database. If you simply renamed the DBC, DCX and DCT, you would lose the connection with the client table."
Olaf said:But I also successfully renamed a database with the Rename context menu item of the database item in a project manager. Which includes renaming the backlinks in all database tables.