SQL: 003 : Cannot open database ‘MainDB_sdx’ requested by the login. The login failed

SQL: 003 : Cannot open database ‘MainDB_sdx’ requested by the login. The login failed

Error Message:

ErrorCode: 61443

Message:
Failed to connect to database 'MainDB_sdx'. (ErrNo:-2147467259
Details:Cannot open database "MainDB_sdx" requested by the login. The login failed.)

Cause: This issue usually occurs when SOHODOX is unable to connect to the SQL Server based MainDB_sdx.

Solution: You have to make sure the SQL Server service is running and the MainDB is accessible in the SQL Server. Follow the steps below to resolve the issue...

Step1: 

Restart the SQL Server service

  1. Go to Control Panel >> Administrative Tools >> Services panel in Windows.
  2. Search for SQL Server (…) service from the Services panel.
  3. Restart the SQL Server service. That’s it!
Now start SOHODOX you should be able to login. If you are not able to login then follow Step 2

Step 2: 

The Microsoft SQL Server must have marked the SOHODOX MainDB_sdx as a Suspect.  To confirm this, follow the below steps… 

Start the Command Prompt as Administrator.

Type...
cd C:\Windows
Press Enter.
Type...
sqlcmd -S .\SDXSQLEXPRESS -Q "SELECT state_desc as Database_status FROM sys.databases where name='MainDB_sdx'"
      where SDXSQLEXPRESS is name of your SQL Server instance. You can replace this with the name of your SQL Server instance.
      If you do not know the name of your SQL Server Instance, please run the following command...
            sqlcmd -Q "Select @@servername" 
      (The result will be displayed in the format 'MACHINE-NAME\INSTANCE-NAME')
      Once you know the instance name, run the above command.

Press Enter.

The state of the database will be displayed. If it is marked are SUSPECT, proceed with to STEP 3:...

Note: If the state of the DB is marked as any other than SUSPECT, please write to support@sohodox.com

Step 3:

Fixing a DB marked as Suspect

Important! Proceed only if you have the latest back-up of the MainDB_sdx

Open Command Prompt Window as Administrator and  run the following commands...

Type...
cd C:\Windows
Press Enter.
Type...
sqlcmd -S .\SDXSQLEXPRESS -Q "EXEC sp_resetstatus [MainDB_sdx];"
Press Enter.
Type...
sqlcmd -S .\SDXSQLEXPRESS -Q "ALTER DATABASE [MainDB_sdx] SET EMERGENCY DBCC CHECKDB([MainDB_sdx])"
Press Enter.
Type...
sqlcmd -S .\SDXSQLEXPRESS -Q "ALTER DATABASE [MainDB_sdx] SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CHECKDB ([MainDB_sdx],REPAIR_ALLOW_DATA_LOSS)"
Press Enter.
Type...
sqlcmd -S .\SDXSQLEXPRESS -Q "ALTER DATABASE [MainDB_sdx] SET MULTI_USER"

Now start SOHODOX everything should work fine.

    • Related Articles

    • SQL: 001 : SQL Server does not exist or access denied

      Error Message: ErrorCode: 61443 Message: Failed to connect to database 'MainDB_sdx'. (ErrNo:-2147467259 Details:[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.) Cause: The error indicates that SOHODOX is unable to ...
    • Convert your existing SQL Express Sohodox DB to SQL Server Standard/Enterprise Sohodox DB

      Note: The below instructions will only work if… You have an existing installation of SQL Server Standard or Enterprise (if you are unsure, drop an email to support@sohodox.com) You have purchased the SQL Server upgrade module. You have the new ...
    • Attach MDF and LDF files to SQL Server Management Studio

      If you are using SQL Express Edition, please download the SQL Server Management Studio from the link below...  https://www.microsoft.com/en-in/download/details.aspx?id=42299  Please download the file 'MgmtStudio 64BIT\SQLManagementStudio_x64_ENU.exe' ...
    • Backup SOHODOX DBs using SQL Server Management Studio

      To backup the DBs using SQL Server Management Studio follow the steps below: Open 'SQL Server 2014 (or any) Management Studio'. On the 'Connect to Server' window, change 'Authentication' to 'SQL Server Authentication' Please enter your MS SQL ...
    • Configure Sohodox to point to an existing SQL Server DB

      To to this... Press the Windows + R button. The Run dialog will be launched. In the Open: textbox, type the following command… "C:\Program Files (x86)\Sohodox Desktop\Sohodox.exe" /reconfiguremssqlmainDB /dbname=MainDB_sdx (Assuming Sohodox is ...