[en] The Web application shows the error message "Cannot connect to database"

La traduction officielle n'est pas encore disponible.

[en] Problem

[en] You connected your web printing solution to your database. When you start the application, it will try to establish a connection and get records from a table.

[en] When running the application, you might see the error message such as:

[en] Cannot connect to database.

[en] Data source name not found and no default driver specified.

kb245-error_message.png

[en] Solution

[en] The application runs in your browser, but it does not connect to the database source directly. There is a service running in the Web Printing site on the server where you installed NiceLabel Web Printing. The application forwards the data request to the service, which makes a connection to the database.

[en] The Web Printing site uses the application pool EPWebPrintingAppPool to isolate the web application for better security, reliability, and performance. The application pool executes commands using a security account. By default, the security account is predefined to Network Service.

[en] Network Service account causes the error. The service cannot connect to the database.

[en] SOLUTION 1

[en] Allow the security account Network Service the connection to the database.

[en] SOLUTION 2

[en] Change the security account that the application pool uses to access database resources.

  1. [en] Run Internet Information Services (IIS) Manager on the server, where you have installed NiceLabel Web Printing server components (Web Printing site).

  2. [en] In the left navigation pane, expand server_name node, then expand Application Pools.

  3. [en] Right-click the EPWebPrintingAppPool application pool and select Properties.

  4. [en] Go to the Identity tab.

  5. [en] Change the security account that the application pool uses. Select the account that Web Printing site can use to get access to the database.