Hello Jerry,
For change back and forward link in database and tables contained in moved database try this code:
*********************************************************
*
* I write this code for you. Try it.
*
*********************************************************
LOCAL lnDbf
PRIVA aDbfs
LOCAL lcDbfPath
LOCAL lcDbcPath
LOCAL lcDbcNewPath
lcDbfPath='.\Data\'
lcDbcPath='.\Data\'
lcDbcNewPath='.\'
open data (lcDbcPath+'Ucto') excl
set databases to Ucto
lnDbf=adbob(aDbfs, 'TABLE')
*
* YOU MUST SAFETY OFF !!!
*
set safety off
for iDbf=1 to lnDbf
remove table (aDbfs[iDbf])
endfo
set safety on
close data all
*
* MOVE YOUR DATABASES
*
copy file (lcDbcPath+'UCTO.DBC') to (lcDbcNewPath+'UCTO.DBC')
copy file (lcDbcPath+'UCTO.DCT') to (lcDbcNewPath+'UCTO.DCT')
copy file (lcDbcPath+'UCTO.DCX') to (lcDbcNewPath+'UCTO.DCX')
dele file (lcDbcPath+'UCTO.DBC')
dele file (lcDbcPath+'UCTO.DCT')
dele file (lcDbcPath+'UCTO.DCX')
*
* NEW PATH TO DATABASES
*
open data (lcDbcNewPath+'Ucto') excl
set databases to Ucto
for iDbf=1 to lnDbf
add table (lcDbfPath+aDbfs[iDbf])
endfo
*
* CLOSE ANY USED TABLE CONTAINED IN OPENED DATABASES
*
close table
*
* REMOVE UNUSED RECORDS IN DATABASES
*
pack data
close data
*********************************************************
Hi Roman
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only