Understand Database Connectivity

HotDocs uses ActiveX Data Objects (or ADO) as the primary means of communicating with databases. ADO allows greater flexibility in the types of databases you can access and gives you greater control over how you extract information from a database.

In order to connect HotDocs to a database using an ADO connection, you must link your template to the database using an OLE DB provider. An OLE DB provider acts as a "translator" between HotDocs and the database, telling the two how to interpret the information that is being passed from the database to the template. Many database programs and/or clients include their own native OLE DB providers, but if you are using a database for which no provider is available, you can use an ODBC driver for your database and the OLE DB provider for ODBC. An ODBC-type connection allows you to connect to the database using an ODBC DSN (data source name), which associates a database driver with the database itself. This help file includes instructions for setting up both types of connections—see Create a Database Component Using ADO or Create a Database Component Using ODBC. (For additional information on ADO connections and data link properties, please either refer to the Windows system help or refer to the help files installed with your particular database program.)

Once the connection to the database is made, HotDocs must know what information to retrieve from the database. You do this by linking variables in the template to fields in a database table or view. Optionally, you can set up filtering and sorting options and designate other custom options that change how records are retrieved from the database.

To perform these various tasks, you can use the features available in the Database Editor, which is a component-editing dialog box like those used to edit other components. However, if you have experience writing database commands, you can specify an option that will allow you to define these filters, etc. using your own command text. Be aware, however, that writing custom commands requires you to have experience using the query language (SQL or other database query language) required by your specific database program. Because of the large number of databases (and potential language variants) little effort is made in this help file to teach this. This help file does contain, however, some general guidelines to help you write your custom commands. (See Use a Custom Command to Retrieve Data from a Database.)

If you are converting database components created in HotDocs 5 to the latest HotDocs format, you should consider changing the type of connection you are using to use an OLE DB provider for the specific database program, rather than the OLE DB provider for ODBC. For information, see Convert ODBC-based Connections to ADO.

Â