KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Opening an external database requires both a structure and data file.
PRODUCT: 4D | VERSION: 14.1 | PLATFORM: Mac & Win
Published On: November 11, 2014

In order to open an external database when using commands USE DATABASE DATAFILE or USE REMOTE DATABASE DATAFILE through SQL, a database structure ".4db" or ".4dc" is required. Although the command takes the parameter of the data file ".4dd", it does not mean it is only required. 4D usually starts up atleast requiring a database structure file and a data file but with this feature, it will assume that the data file being pointed to has the associated structure file.

Image below shows the files needed for Windows to open an external database:



For the Mac, a 4D database is formed as a package so the structure and data file are intact shown below:



4D can take care of the 4D database that is in a package for Macs to recognize the files needed when opening the external database.

If the structure file is not found when trying to use the commands (USE DATABASE DATAFILE or USE REMOTE DATABASE DATAFILE) in SQL, it will display a runtime error as the following:



The feature overall allows the current 4D application to switch to a specific database temporarily and then resume to the normal database that it started via SQL.

See Also: