SAP Knowledge Base Article - Public

1216863 - How to connect through ODBC with a connection string

Symptom

  • How do you connect to a data source by way of a connection string either with or without an ODBC DSN?

Environment

  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Resolution

Two sets of steps to use a connection string are provided. These steps include examples where the example data source is a Microsoft SQL Server database.

Steps to Create a Connection String with a DSN

----------------------------------------------

1. Create a new blank report in Crystal Reports.

2. Select 'Create new connection'.

3. Expand the 'ODBC' folder option.

4. Scroll down and select 'Connection string' instead of selecting an ODBC DSN.

5. Type in the connection information.

Example:

DSN=SQL Server Production Database;

Database=Xtreme;

UID=SalesRep;

PWD=password1234

Explanation:

" DSN is equal to the data source name created in the ODBC Administrator.

" Database is equal to the file name of the database.

" UID is equal to the user name required for the database logon.

" PWD is equal to the password required for the database logon.

Steps to Create a Connection String without a DSN

-------------------------------------------------

1. Create a new blank report in Crystal Reports.

2. Select 'Create new connection'.

3. Expand the 'ODBC' folder option.

4. Scroll down and select 'Connection string' instead of selecting an ODBC DSN.

5. Type in the connection information.

Example:

Driver=SQL Server;

Server=SQL Server Production Server;

Database=Xtreme;

UID=SalesRep;

PWD=password1234

Explanation:

" Driver is equal to the name of the ODBC driver required.

" Server is equal to the server name.

" Database is equal to the file name of the database.

" UID is equal to the user name required for the database logon.

" PWD is equal to the password required for the database logon.

Keywords

DSN ODBC CONNECTION STRING DATABASE DSN-LESS DSNLESS DSN LESS Crystal Reports ODBC Connection String DSNless Connection , c2014473 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports 9.0