Database Connection
Flying Popcorn allows you to connect to Microsoft Access database files (*.mdb) and link objects to the content of the database. Specifically, text, TextBox, image, and media objects can be linked to a database. You can also use actions to peform operations on the database. This allows you to do such things as display a record from the database in a text object. Or you can keep a database file of text file names, and use it to call up a text file and display it in a textbox.
In order to use a database with Flying Popcorn, you must first create a database connection. This mainly entails showing Flying Popcorn the location of the database file (*.mdb). After that, you can use the database by clicking on the database column link settings in the Attributes tab of the Object Properties dialog box. This process is discussed in detail in this section. You can also access the database through actions.
To connect to a database
- Make sure you have a Microsoft Access database file (*.mdb) on your computer.
- In the File menu, click Database Settings.
- Click the Connect to DB button.
- Select the *.mdb file on your computer.
- Adjust the settings and click OK.
When selecting the database in the Database Settings dialog box, you are given the option of selecting the primary key for the database's table. This is used for selecting and sorting the database records. A database record's primary key identifies the record. Click the Primary Key button and then a table and choose a column name. For sorting purposes, the primary key column must contain all unique records.
Once you have set the primary key, you can set the AutoSync page. This function synchs the page that you are on with the record that you are viewing. Thus, if you go to the next page in the project, the database will automatically display the next record. To set this function, click the Auto Sync Page button. In the dialog box that appears, uncheck the Disable Auto Sync Page Function checkbox. Then select a page to be synched with the first record in the database.
Also in the Database Settings dialog box, you are given options related to copying files when publishing your project. When you publish a project by creating an Autorun, creating a screen saver, or doing web publishing, you need to include all of the necessary files. If the database links to other files (i.e. contains records with filenames for accessing files), you need to include these files. Therefore, you should choose the Copy all files and sub-files in the same folder option. If the database does not link to other files, then you need only include the database file. In this case, choose the Copy DB file only option.
Using a database
Once you have made a connection to a database, the objects in your project can use it. This is done by making a database column link to the object. This means that the object is linked to a column in your database and can read the records in that column. Only text, TextBox, Image, and Media objects can have database column links. Once such a link has been established, you can do such things as have a text object display a record from the database, or have the database hold selection of media file names and open those with a media object.
To create a database column link
- Right-click the object and click Properties in the context menu.
- In the Object Properties window, click the Attributes tab.
- In the Database column link section, click the Settings button.
- In the Link column settings dialog box, choose the table name and the column name.
- Adjust any other settings and click OK.
Linkable Object Types
The following is a list of the object types that can be linked to a database and how they behave when you link them.
- Text: Displays the contents of the records in the column.
- TextBox: Shows the contents of the records in the column or load files that have filenames contained in the records. To open files, check the Load/Save the document file in linked column checkbox in the Link column settings dialog box. Otherwise, it will load the actual content of the database records.
- Image: Loads image files. You must select a column that contains the names of images files in the same folder as the database. In the Link column settings dialog box, you can choose how the images are sized if they differ from the current image object. Max Size means that small images are enlarged but will not exceed the height and width of the current image object and will stay within the boundaries. Less Size means that small images are displayed in their original sizes (stay within the boundaries) and will not exceed the height and width of the current image object. Original Size means that the image is displayed in its original size independent of the height and width of the current image object. If none of these options are checked, the images will be displayed as the same size as the current image object.
- Media: Loads media files. You must select a column that contains the names of media files in the same folder as the database.
|