Tutorial: Setting up an ODBC Data Source
Most databases are accessed through ODBC, and you will need to set up an ODBC driver before you can report from your database. In this tutorial, we are going to set up an ODBC driver for the sample Access database that ships with Crystal Reports 10 and then use it to create a report.
Note: These instructions are for Windows XP. If you are using Windows ME/2000, consult your system administrator for ODBC setup instructions.
Step-by-Step
1. Open the Windows control panel and open Administrative Tools and then Data Sources (ODBC) to open the ODBC Data Source Administrator.
2. Select the System DSN tab and then click the Add button
3. In the next dialog box, scroll down the list and select Microsoft Access (.mdb) as the data source type.
4. Using the dialog box that opens, enter a name for your data source. In this example, enter My Data and use the Select button to locate and select the sample Xtreme database that ships with Crystal Reports (usually located under c:\Program Files\Crystal Decisions\Crystal Reports 10\Samples\En\Databasesxtreme.mdb).
Note: Crystal Reports ships ODBC drivers for the following databases: Oracle, Informix, Sybase, DB2, SQL Server, FoxPro, and SQL*Base. For more information on configuring these drivers, consult the help files that reside in the /Windows/System32/ subdirectory, prefixed by CR (for example, CRSYB14.HLP).
5. Click OK to accept your changes. Your new data source should now appear within the ODBC Administrator, under System DSN.
6. Exit the ODBC Administrator and open Crystal Reports from the Start menu.
7. Select File | New and select the Standard Report Expert.
8. On the Data tab of the Standard Report Expert, expand the folder marked Create New Connection to see a list of available data sources. Expand the folder marked ODBC(RDO)
9. Select the data source you just created and click Finish. The tables from your data source will be listed.
9. Select the tables, fields, and so on that you want to see in your report, complete the report expert, and preview your report.
Summary
Crystal Reports provides a number of data access methods, the most popular being ODBC. Before you can create a report through an ODBC connection, you first need to set up an ODBC driver that points to your database. With that done, all of the data held within the database is available for reporting
Applies
to: Crystal Reports 10
©
Copyright 2006 by Crystal Developers Journal
Top of Page
|