Courseiva
mediumMultiple ChoiceObjective-mapped

PK0-005 Practice Question: Refer to the exhibit

Exhibit

Refer to the exhibit.

=== C:\Project\Build\app.config ===
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="DatabaseServer" value="prod-db-01.internal.company.com"/>
    <add key="DatabaseName" value="SalesDB"/>
    <add key="Environment" value="Production"/>
  </appSettings>
  <connectionStrings>
    <add name="SalesDB" connectionString="Server=prod-db-01;Database=SalesDB;User ID=app_user;Password=Passw0rd!" providerName="System.Data.SqlClient"/>
  </connectionStrings>
</configuration>

=== Deployment Instructions ===
1. Copy app.config to C:\App\
2. Update connection string for environment
3. Restart service

=== Error after deployment ===
System.Data.SqlClient.SqlException: Cannot open database "SalesDB" requested by the login. The login failed.
Login failed for user 'app_user'.

Refer to the exhibit. A developer deployed a new version of an application to production. After restarting the service, the application fails to connect to the database. What is the most likely cause?

⚠ Common exam trap

CompTIA often tests the distinction between authentication failure (wrong password) and authorization failure (lack of database permission), and candidates mistakenly choose the password option because they assume any login error is due to credentials.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The database user 'app_user' does not have permission to access the 'SalesDB' database.

The exhibit shows that the connection string in the application configuration explicitly references the 'SalesDB' database and uses the 'app_user' account. The error message indicates a login failure for user 'app_user', which in SQL Server typically means the login succeeded at the server level but the user lacks a mapped database user or the CONNECT permission on the specified database. Since the database name and server are correctly specified, the most likely cause is that 'app_user' does not have permission to access 'SalesDB'.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The database user 'app_user' does not have permission to access the 'SalesDB' database.

    Why this is correct

    The error 'Cannot open database' for a valid login indicates lack of database-level permissions.

  • The database server name in the configuration is incorrect.

    Why it's wrong here

    The server name appears valid and the error is about database access, not server resolution.

  • The application is not configured to use the correct environment.

    Why it's wrong here

    The environment key is set to Production, which is appropriate.

  • The password in the connection string is incorrect.

    Why it's wrong here

    If the password were wrong, the error would be 'Login failed for user' but could also be 'password mismatch'. However, the error message specifically says 'Cannot open database' which suggests the login succeeded but database access is denied.

About these practice questions

This PK0-005 question is part of Courseiva's 980-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PK0-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PK0-005 exam.