KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Selecting a different data file
PRODUCT: 4D | VERSION: 2003 | PLATFORM: Mac & Win
Published On: May 6, 2004
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Using the same structure file, you can select a different data file or create a new data file. You can do this while opening a database or programmatically while the database is open. When opening a database, you can select a different data file or a new data file by pressing the Alt key (Option on Mac OS) or by clicking 'other' in the expanded options area of the Open Database dialog box. You can select a different data file or a new data file programmatically by using the 'Open Data File' or 'Create Data File' command. These commands take the access path of the data file as argument and open or create a data file replacing the current data file opened by the application.

The code below will replace the current data file with a data file 'Backup1.data' (Mac OS) located in the 'Project' folder:
C_Text($accesspath)
$accesspath:="Mac HD:Project:Backup1.data"
Open Data File($accesspath)