Article ID: 173878
Article Last Modified on 12/11/1999
PARAMETERS lcDBC, lcFromDrive, lcToDrive
&&lcDBC = Database Container in the project.
&&lcFromDrive = The drive where the project was originally.
&&lcToDrive = The drive where the project is moved to.
if ( pcount() = 1 )
if ( lower( getenv( "Machine" ) ) == "dfsd pentium" )
lcFromDrive = "e" &&Drive where project originally located.
lcToDrive = "h" &&Drive where project is moved to.
else
lcFromDrive = "h" &&Drive where project originally located.
lcToDrive = "e" &&Drive where project is moved to.
endif
endif
lcFromDrive = lower( lcFromDrive ) + ":\"
lcToDrive = lower( lcToDrive ) + ":\"
use (lcDBC + ".dbc")
scan for objecttype = "Field"
if ( at( lcFromDrive, Property ) > 0 )
replace property with strtran( property, lcFromDrive, lcToDrive )
endif
endscan
use
Save the file, in the project directory (VFPApp), as movedbc.prg.
SET DEFAULT TO d:\VFPApp
movedbc("qa","c","d")
Now when you open the project and then modify the table, you will not get
the error message, and the Field mapping information will be retained.
MD c:\vfp5app
CREATE CLASSLIB C:\vfp5app\ccontrols.vcx
CREATE CLASS ctextbox OF ccontrols AS TextBox
CREATE PROJECT c:\vfp5app\qa
CREATE DATABASE c:\vfp5app\qa
CREATE TABLE qa ( iID i, cText c(10) )
Make sure that the database is open and active when you create the table
so that the table is added to it.
Keywords: kbprb KB173878