Getting Started

Being able to use a Database in Opus Pro is an incredibly useful and powerful tool, however, it does require some planning, especially if you are unfamiliar with using databases. Therefore, if you intend to use a database in Opus, you should consider the following:

Decide on your publication type:

  1. First you should decide what publication type you want to create. In other words, do you want to deliver the publication to the user as a standalone publication (i.e. an EXE program) or over the web (i.e. an I/O Plug-in or Opus Flex publication) ?

  2. If you create a standalone publication, you can create your database using a standard Window’s based database program, such as MS Access.

  3. If you create a web-based publication (i.e. the publication is accessed over the Internet), you CANNOT use MS Access, you must use a web-based database, most likely mySQL. This would require someone who understood how to create a database with mySQL as well as a good knowledge of Servers and database administration over the web.

Create the Database:

  1. Before you can connect to a database in Opus, you must first have created the database. That means, you must have created the structure of the database i.e. the fields that make up the table.

Note:
You do not necessarily have to have entered any records in the database, especially if you are using an Opus publication as a way of providing a user-friendly interface so that users can input data into your database.

  1. If your publication is intended to simply show records from a database, for example, a list of Sales products, you will need to have added records to the database.

Note:
It may not be you who enters the records; the database may already be an existing one that your company has created, in which case, your job is half done!

Connecting to a database in a Standalone publication:

  1. Connecting to a database with a standalone publication is fairly straightforward. The Database Query action allows you to connect to a database, set up which records you want to use from the database and assign variables so you can display the records information on a page in Opus.

Note:
The Database Query action is the most important aspect of working with databases in Opus – once you understand how to use the Database Query action everything else is relatively straightforward – see Database Query action for more information.

  1. Part of the Database Query action requires you to use a DSN – see Connecting to a Database for more information.

  2. Also, the Database Query action requires you to create a Query – see Creating a Query for more information.

  3. Once you have completed the Database Query action, you can use the other Database actions so that you can show different records from the database in your publication – see Introducing the Database Actions, Showing Records from a Database in Opus and Making Databases Interactive for more information.

  4. If you only want specific users in your publication to be able to access the database, you can limit access to authorised users – see Database tab in Publication Properties for more information.

  5. Finally, when the standalone publication is published, you must provide the database along with the publication. For example, if your publication is distributed on a CD-ROM, the CD must contain the database or already be on the users machine or available over a network. If the publication is run from a network, the database must be available on the network.

Connecting to a database in a web-based publication:

  1. Connecting to a database with a web-based publication does raise some issues that you should be aware of before you begin your project, so you can make an informed decision on the way forward.

  2. As stated previously, you must use a web-based database program, such as mySQL. The Database Query action can be used with mySQL databases, however, it is NOT recommended for the following reasons:

    1. Unless your development machine is also the Server on which the mySQL database will reside when the publication is published, you will need to work online when you set up the Database Query action and as you preview the publication.

    2. The users machine will have to have the mySQL drivers installed on their machine or they will not be able to run the publication – by default, these drivers are not installed on standard PC’s.

  3. An alternative method for connecting to your mySQL database in Opus Pro is to use the Post Web Data action – this is the recommended solution.

Note:
See Post Web Data action for more information.

  1. The Post Web Data action allows you to send and receive information to and from a Server. This does mean you will need a developer on your team who is familiar with creating cgi-scripts so you can extract the records from a database.

  2. To display the record information to the user on a page in Opus will simply mean inserting a variable in a Text object on a page – see Displaying Variables on a Page for more information.

  3. To show different records on a page in Opus, you will need to use another Post Web Data action that calls a cgi-script that will perform this function for you.

  4. Finally, when the web-based publication is published, the user must be online to run the publication – the database (if it is on the Server) can be accessed automatically.

Key Samples

There are two sample databases provided as sample publications with the program. Both provide a simple catalogues type database one using Access, the other using Excel. You can review these samples to provide further assistance in getting started with databases.

Related Topics:

Working with Databases - Overview

Introducing the Database Actions