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

Update for 2019:

Please note, newer versions of The Report Viewer require you to put the ODBC DataSource Name (DSN) into the server field, and the actual Database Name into the database field. This differs from advice that we have previously given.
It seems to very depending on the database vendor. For many SQL Server installs, we have had to put the ODBC DataSource Name (DSN) into the server field and the actual Database Name into the database field.

Contact us if you require assistance setting up your connection. It often helps if you send a report without saved data, so we can see how the report was designed to connect to the database.

Previous directions are below. We advise you to read through them, to help understand how The Report Viewer accesses your database.


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