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.
- Check the report, and see what DSN it is references.
- 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
- If any reports are open in The Report Viewer, close them.
- Open The Report Viewer.
- Select "use embedded connections" in the connections drop down.
- 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.
Option 2: Overriding the ODBC database connections that are embedded in the report
- 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: C:\Windows\SysWOW64\odbcad32.exe
- Close any reports that you have open.
- 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.
- Select the connection you just saved in the connections drop down box.
- 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.

