OLE DB Data Sources

book list add book to my bookshelf create a bookmark purchase this book online

mastering crystal reports 9
Chapter 10 - Data Sources and the Database Expert
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

In 1996, Microsoft continued the evolution of its data access strategy (which is “Make it easy!”) from ODBC to OLE DB to address performance and extensibility concerns left unaddressed by ODBC. There are a large number of ODBC installations and this trend will continue, but the option to look to OLE DB is attractive. The process of accessing a database has been simplified even further with this newer methodology.

OLE DB consists of a set of programming interfaces that provide applications such as Crystal Reports with consistent, fast access to any kind of tabular (row/column) data. This includes and then goes beyond traditional relational data and expands data access possibilities to OLAP (Online Analytical Processing) data, e-mail containers, file systems, text, and graphics. Figure 10.10 depicts an application’s interactions with an OLE DB interface that connects to a data source. Since no driver manager is involved in the transaction, the performance of OLE DB is positioned to be better than that of ODBC from the start.

click to expand
Figure 10.10. OLE DB

The core component of OLE DB is known as a provider, representing a provider of data or services to the data. There are two categories of providers:

  • Data providers

  • Service providers

The data provider component connects a data source to an application that needs to access it. Service providers do a slightly different task by interacting between an OLE DB data provider and a software application for extended functionality such as query processing. In other words, a service provider goes beyond the retrieval of the data.

In the Database Expert, the OLE DB option appears two entries down from ODBC (this is an alphabetical list!). When you select OLE DB, the Crystal Reports process mirrors the one for connecting to an ODBC source. The difference, however, is that you do not have to configure an OLE DB connection to a database at the operating system level as you did with ODBC. Figure 10.11 displays a list of OLE DB providers.

click to expand
Figure 10.11. OLE DB Provider

The list includes an OLE DB driver for every type of database installed on the system as well as several built-in ones. Notice that the list has providers for popular databases like SQL Server and Oracle. The OLE DB driver is provided by the database manufacturer. After you choose the OLE DB provider, the next step is to provide the connection information required to access a specific database. In Figure 10.12, a connection is being made to a server that requires a user ID but no password.

click to expand
Figure 10.12. OLE DB connection

After the connection is made, the server name and the individual database are added to the list of Available Data Sources in the Database Expert, as shown in Figure 10.13.


Figure 10.13. SQL Server OLE DB

start sidebar
Rules of Thumb for Choosing between ODBC and OLE DB
  • Use ODBC if your data is relational and in a non-OLE environment.

  • Use OLE DB to access non-SQL data.

  • Use OLE DB if you’re writing code to access data in an OLE environment.

  • Use OLE DB to build interactions between multiple database components.

end sidebar

Note 

If the Current Connections folder in the Database Expert was opened at this point, the SQL Server connection just accomplished with OLE DB would be listed. Likewise, the History folder would capture it automatically as well. The Favorites folder, on the other hand, is manually updated, so the connection would not automatically appear in this folder.

OLAP Data

OLAP (Online Analytical Processing) involves real-time interactions with data that is represented in multiple dimensions. OLAP data is depicted as a cube, which is three-dimensional. OLE DB has a major advantage over ODBC in that it can handle n-dimensional tabular data. While row and column data is two-dimensional and represents the typical table we think of in a relational database, once you move to three dimensions or beyond, ODBC has no way to interact with the data. OLE DB, on the other hand, can handle any number of dimensions. Version 2.0 of the technical specification for OLE DB includes OLE DB for OLAP and details the programming methodology required to interact with this type of data.

Crystal Reports can report on OLAP data sources, and the first step is, not surprisingly, connecting to it. The Database Expert contains a folder for OLAP, which makes use of OLE DB behind the scenes for its data access methodology. When connecting to an OLAP data source, you have the option of connecting directly to an OLAP server (a server dedicated to this type of data) or using a cube file. Cube files are OLAP data that has been saved to a file rather than generated in an OLAP server in real time. An HTTP cube is OLAP data that can be accessed through a web browser. Figure 10.14 shows an OLAP connection configuration dialog.

click to expand
Figure 10.14. Connecting to OLAP data

The process of working with OLAP data in Crystal Reports is to use cubes of data. The representation of the information is in three dimensions initially; think of it in terms of length, width, and depth. The intersection of the three dimensions is a single cell of data, just as the intersection of a row and column in relation data is a single cell of data. In retrieving the data, each dimension consists of an aggregation (summarization) of a data item to allow drilling up to a higher summary level or drilling down to a more specific data level. The OLAP Connection Browser can connect to an OLAP server, a stored cube of data that was previously generated, or an HTTP cube of data. After you connect by clicking the Add Server button in Figure 10.15, the OLAP data source appears in the list of Available Data Sources, as shown in Figure 10.16.

click to expand
Figure 10.15. Adding an OLAP server


Figure 10.16. OLAP cubes

Once the OLAP Connection Browser is connected to the data source, the OLAP Expert in Crystal Reports is used to build a report using OLAP data. For more information on using the OLAP Expert, refer to Chapter 12, “Analyzing Data Visually.”

Use of content on this site is expressly subject to the restrictions set forth in the Membership Agreement
 
Conello © 2000-2003     Feedback


Mastering Crystal Reports 9
Mastering Crystal Reports 9
ISBN: 0782141730
EAN: 2147483647
Year: 2005
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net