Add a meta-schema to the project (4dbx)
Your application will access the sample officestore database. You must create a meta-schema file based on this database, and you will set the DBPATH environment variable to the directory containing the database file.
The SQLite database named officestore.db, is located in My Genero Mobile Files/samples/OfficeStoreRes/database-sqlite/. From this database, you create a .4dbx schema file. It will later be used to create items in your Business Application Diagram (4ba).
- Select the officestore.db file located in the My Genero Mobile Files/samples/OfficeStoreRes/database-sqlite/ directory and copy it to the database directory of your project directory.
-
Select Database > Extract Schema....
The New Meta-schema dialog opens.
-
Complete the Meta-schema file step.
-
Click on the File Browser icon next to the Meta-schema file path
field.
The Save File As dialog opens.
-
Navigate to your project directory and select the database directory.
Enter "officestore" in the File name field. Select "Genero Database Schema
Files (*.4dbx)" in the Save as type combobox. Click
Save.
Note: Make sure the file created is a .4dbx file, as this is the database meta-schema file for generated applications.
- Ensure the Insert the file in the project check box is selected.
- Select the Database node.
- Click Next.
-
Click on the File Browser icon next to the Meta-schema file path
field.
-
Complete the Connection information step.
-
Select "SQLite" as the Database type.
The Database driver defaults to "dbmsqt".
-
Click on the File Browser icon next to the Database file field.
The Save File As dialog opens.
- Select the officestore.db file located in the database directory of your project directory.
- Click Test Connection to verify that the connection is successful, then click OK to close the connection test dialog.
-
Click Finish.
The dialog closes, and the officestore.4dbx file is created.
-
Select "SQLite" as the Database type.
-
Add the DBPATH environment variable to the DB-SQLite environment set.
The application needs to know where the database file sits at runtime. DBPATH is used to specify the path to the file.
-
Select Tools > Genero Configurations
The Genero Configuration Management dialog opens.
- Under Environment Sets, select "DB-SQLite".
-
Click the green plus icon.
The Environment Variable dialog opens.
- In the Type combobox, select "Directory List".
- In the Name field, enter "DBPATH".
- In the Value field, use the File Browser to locate the path My Genero Files/samples/OfficeStoreRes/database-sqlite/.
-
Click OK.
The DBPATH environment variable is added to the DB-SQLite environment set.
- Ensure the DB - SQLite environment set is selected (checked).
-
Click OK.
The Genero Configuration Management dialog closes.
-
Select Tools > Genero Configurations
-
Open the Project node and right-click on the
Application node. Select Advanced Properties from the
menu.
The dependencies for the Config, Database, Entities, and Resources nodes have already been set. Selecting these nodes as dependencies ensures that files they contain will be accessible for inclusion in your application.
-
Select the fglprofile file located in the My Genero Mobile
Files/samples/OfficeStoreRes/database-sqlite/ directory and copy it to the
config directory of your project directory.
The FGLPROFILE file contains the configuration information to access the sample databases.
-
In the Advanced Properties dialog, add an FGLPROFILE environment variable
to the Environment Variables page.
- Select Environment Variables.
- Under the User Variables section, click the green cross icon.
- In the Environment Variable dialog, add the FGLPROFILE user variable. Specify a type of "File List", and have the Value point to the location of the FGLPROFILE file provided in the config directory of your project directory.
- Click OK to close the Environment Variable dialog.
- Click OK to save and close the Advanced Properties dialog.
- Save the changes to your project.