Crystal Reports can be designed using database connections such as a command object, table(s), and /or stored procedure(s). This article will highlight the database connections available to you for use in Crystal Reports.
Connection types are:
* Native
* OLEDB
* ODBC
The following is an overview of these connection types.
Native Connection:
* Native connections are direct connections.
* Native connection are the fastest method of connecting to a data source.
* Logging in to the database without creating a Data Source Name (DSN) in ODBC administrator is required to use the Native databases.
*It has direct control over tables with the ‘Set Location’ command in Crystal Reports.
ODBC Connection:
* Open Database Connection requires middleware (allows direct access to data structures and provides interaction directly with databases) to connect to Crystal Reports.
* ODBC connections are compatible with most of the ODBC-compliant databases.
* Hundreds of ODBC drivers exist, including drivers for enterprise DBMS such as Oracle, DB2, Microsoft SQL Server, Sybase, Pervasive SQL, IBM Lotus Domino, MySQL, PostgreSQL, OpenLink Virtuoso, and desktop database products such as FileMaker, and Microsoft Access.
* It allows more control over table joins (Inner-join, Left Outer Join, Right-Outer Join)
* It allows parametrized queries.
* SQL statements communicate between database and the CR application
OLE-DB Connections: (Object linking and Embedding Databases)
* OLE DB Connections use third party software (OLE DB) to communicate between CR and the database.
* It exchanges data by providing an interface layer to communicate between the application and the DB.
* OLE DB connections use SQL statements to communicate between CR and the database.
* It does not require a DSN to be configured.
* It is the slowest type of database connection.
On opening Database Expert from the Crystal Reports Database menu you get a window with a multitude of data connections. The most common of them are:
1. Access/Excel (DAO) – Lets you connect supported database types like: Access, Excel, Lotus etc.
2. OLE DB(ADO) Shows a list of OLE DB providers you have already configured for use.
3. Database Files – This option shows a list of standard PC databases that reside locally. PC databases include: Paradox, ForPro 2.6, Visual ForPro, ACT!, Btrieve etc.
4. Repository – Shows the contents of your repository through Business Objects Enterprise Explorer.
To add a data source to your report, you can choose Database Expert from Database menu to select the data source. Once you have created a connection you are ready to design the report as per business requirement.
Once you have successfully connected to your data source by providing the login credentials, the tables, views, Command objects or stored procedures will appear below the chosen data sources’ folder.
Now you can create a report on using the database’s Tables, Views, Stored Procedures, and Command objects. If you aren’t familiar with their structure, you should contact your DBA or local database expert to get more information about their proper use.