This article discusses troubleshooting steps for the error message “Cannot connect to database”, which can be encountered when starting SOLIDWORKS Electrical.
Check SQL Server Services and Protocols
This error may be caused by the SWE SQL server service being stopped or having certain SQL protocols disabled. Go to the computer hosting the SQL server and use the following procedure to check this. Note that if SWE was installed in a standalone configuration (all program components on the same computer), the SQL server will be on the same computer as the main SWE application. If SWE was installed in a client-server configuration, the SQL server will be on the server computer.
- Ensure all users save their work and close SWE on their computers before following these steps. Failing to do so can lead to data loss and corruption.
- Open the SQL Server Configuration Manager from Start > All Programs > Microsoft SQL Server 20xx > Configuration Tools.
- Browse to SQL Server Services and check the status of the service named SQL Server (TEW_SQLEXPRESS). If it is stopped, as in the screenshot below, right-click it and click Start. Note that the SQL instance name (TEW_SQLEXPRESS) may be different depending on the settings used when it was installed.
- Also check SQL Server Browser in this list. Start the service if it is stopped.
- Now browse to SQL Server Network Configuration > Protocols for TEW_SQLEXPRESS. Ensure that Shared Memory, Named Pipes and TCP/IP are all enabled, as in the screenshot below. If not, right-click to enable them, then restart the service SQL Server (TEW_SQLEXPRESS). More information about SQL protocols can be found at this Microsoft TechNet article.
- If nothing needed to be started or enabled at steps 3–5, restart the services SQL Server (TEW_SQLEXPRESS) and SQL Server Browser anyway (right click > Restart).
- Launch SWE to check if the issue is resolved.
Check SWE Application Settings
If this does not resolve the issue, click OK on the error message and in the SWE application open the settings dialogue from Tools > Application Settings. Select the Databases tab. Check the fields for Server name, User name and Password. The default values are indicated below, but these may be different depending on the options selected during installation. Consult with an IT administrator if unsure of the correct values.
Server name in standalone configuration:
Server name in client-server configuration with a server computer named elecserver:
After making any changes, click OK, then restart the program to see if the issue is resolved. If not, further information about the connection issue might be shown by reopening the Application Settings and clicking on Display query execution error log. This will open a text file. Scroll to the end of the file to find the latest messages and look for any information about the connection error. Please save this text file in case this guide does not resolve the error and you need to contact Hawk Ridge Systems Technical Support.
Check Network Connectivity and Security
If the above checks still do not resolve the problem, there may be issues with network connectivity and/or security. An IT administrator should be involved to check these.
For client-server configurations, there needs to be an unblocked network connection between the client and server computers over ports 1433 and 1434. Test this connection with ping and telnet tests. Try temporarily disabling any firewall software. Note that there may be multiple firewalls between the client and server computers.
There could also be problems with anti-virus software or Windows User Account Control blocking functions of the software. Try disabling these temporarily to see if the error still occurs.