Back to Top

Connecting to ODBC Data Source with The Report Viewer (Step by Step)

These steps will help you connect to an ODBC data source using The Report Viewer. This applies to a 4.x version of The Report Viewer.

Option 1: Setting up connection with the connection settings embedded in the report.

  1. Check the report, and see what DSN it references.
  2. Setup a 32 bit ODBC driver with that DSN as the name.
    • The DNS value is case sensitive.
    • If you are using an x64 operating system, make sure you run the 32 bit ODBC administrator.
      • Win7: C:\Windows\SysWOW64\odbcad32.exe
  3. If any reports are open in The Report Viewer, close them.
  4. Open The Report Viewer.
  5. Select "use embedded connections" in the connections drop down.
  6. Refresh it the report.
    • This will work. That will bring data back.
    • If you followed these steps and it's not working, go back to the ODBC driver you created, and test the connection. Also test the ODBC connection with other software.

Screenshot of Crystal Reports Database Expert and Windows 32-bit ODBC Database Administrator

Option 2: Overriding the ODBC database connections that are embedded in the report

  1. Setup a 32 bit ODBC drive remembering the DSN used to create the driver.
    • The DNS value is case sensitive.
    • If you are using an x64 operating system, make sure you run the 32 bit ODBC administrator.
      • Win7 x86 database administrator: C:\Windows\SysWOW64\odbcad32.exe
  2. Close any reports that you have open.
  3. Create a new connection inside The Report Viewer.
    • Add a nickname for this connection, and add the username and password.
    • Set the Server and Database values to the value of the DNS field of the ODBC driver you set up earlier.
    • These values are case sensitive.
    • Save this connection.
  4. Select the connection you just saved in the connections drop down box.
  5. Open your report again, and refresh the data.
    • Make sure that you reopen the reports every time you change the connection settings. The connection settings are only applied once when the report opens, because it's a very slow process.

Screenshot of The Report Viewer Connection Editor and Windows 32-bit ODBC Database Administrator