Solving SQL Server Connection Problem

Inspect Server Settings

There are three significant aspects that users may neglect, which lead to the failure of the connection to the SQL Server.

Enable TCP/IP Connection

To check whether your server enabled to TCP/IP connections:

Open your SQL Server Configuration Manager.

Open SQL Server Configuration Manager
Open SQL Server Configuration Manager

Expand SQL Server Network Configuration and select Protocols for SQLEXPRESS.

Select Network Configuration
Select Network Configuration

Take a look at TCP/IP, which requires to be Enabled. If yours is Disabled, right-click on it and select Enable in the popup menu.

Enable TCP/IP Connection for SQL Server

Also, you may take a look at the Port setting of your server. Right-click on TCP/IP and select Properties in the popup menu.

Open TCP/IP Properties

Click the IP Address tab in the TCP/IP Properties dialog box.

Switch to IP Address tab
Switch to IP Address tab

Under IPAll section, you can see the TCP Port (default: 1433) and you can edit the port of your server.

Configure default port for SQL Server
Configure default port for SQL Server

You will need to restart server after changing any setting in SQL Server Configuration Manager. You can right click on the server instance and select Restart from popup menu.

Restart SQL Server
Restart SQL Server

Allow Remote Connection

Your need to make sure that remote connection to your SQL Server is enabled. To verify this setting:

Startup your SQL Server Management Studio.

Launch SQL Server Management Studio
Launch SQL Server Management Studio

Right-click on the server and select Properties in the popup menu.

Open Server Properties
Open Server Properties

In the Server Properties dialog box, select Connections.

Select Connections
Select Connections

Check the checkbox of Allow remote connections to this server.

Turn on Allow remote connections to this server
Turn on Allow remote connections to this server

Authentication Method

We recommend users to run their SQL Server with mixed authentication mode. To inspect the authentication mode of your SQL Server:

Open SQL Server Management Studio. Then, right-click on the server and select Properties in the popup menu.

In the Server Properties dialog box, select Security.

Select Security setting
Select Security setting

Make sure Server Authentication is set to SQL Server and Windows Authentication Method.

Select SQL Server and Windows Authentication mode
Select SQL Server and Windows Authentication mode

Make sure Hostname and Port are correct

Back to your VP application, have a check in your database configuration and see if you have entered the Hostname and Port correctly.

Select Tools > Database > Database Configuration… in the VP application.

Open Database Configuration Dialog in Visual Paradigm
Open Database Configuration Dialog in Visual Paradigm

Select the LanguageServer, Version and the Driver in Database Configuration dialog.

Select SQL Server for configure connection settings
Select SQL Server for configure connection settings

Enter Hostname, which must be either the IP address of your computer, a mapped host name or the computer name.

Specify the host name or IP address of SQL Server
Specify the host name or IP address of SQL Server

Enter the port of your SQL Server. It’s 1433 by default, but if you have edited the port for your SQL Server or running on other named instance, you need to enter the corresponding port.

Specify the port number of your server instance
Specify the port number of your server instance

Driver File

Visual Paradigm supports to connect to SQL Server with various JDBC driver files. But we recommend users to use the jDTS driver. Visual Paradigm can help you to download and setup the jDTS driver automatically. To download the driver:

Select Tools > Database > Database Configuration.

After you have chosen the language, server and driver, click the green down arrow button beside the Driver file field.

Download jDTS driver file
Download jDTS driver file

VP will download the adapter file for you.

Automatic download driver file
Automatic download driver file

Please note that VP will need to run with sufficient permission in-order to download and install the driver file. You may need to right click on VP’s shortcut and select Run as administrator in order acquire sufficient permission.

Run Visual Paradigm with administrator permission
Run Visual Paradigm with administrator permission

Some driver files cannot be automatically downloaded. In this case, you can press the  button beside the Driver file field to specify driver file from your file system to make connection with your SQL Server.

Specify your own driver file
Specify your own driver file

Adapter File (Specific for language specified as .NET)

While you are using non-compatible adapter file, you will not be able to connect to the server. The simplest way to get the compatible adapter file is let our application download it for you:

Select Tools > Database > Database Configuration.

After select .NET as language, MS SQL Server as the server, click the green down arrow button beside the Adapter file field.

Download adapte file
Download adapter file

VP will download the adapter file for you.

Again, VP will need to run with sufficient permission in-order to download and install the driver file. You may need to right click on VP’s shortcut and select Run as administrator in order acquire sufficient permission.

SQL Server with Windows Authentication

If you are using the Windows Authentication Method, you will need another connection URL in order to connect to the SQL Server.

Java (SQL Server 2005 Microsoft Driver)

jdbc:sqlserver://<server_host>;databaseName=<database_name>;integratedSecurity=true;

Java (jDTS)

jdbc:jtds:<server_type>://[<server_host>:<port>][/<database_name>];domain=XXX

where <server_type> = sqlserver

** Domain Server is required. If no domain server is available, please try domain=workgroup

.NET

Server=%HOST%,%PORT%;Database=%DATABASE%;User ID=%USER_ID%;Password=%PASSWD%;Trusted_Connection=Yes;Domain=%WINDOW_DOMAIN%

You can enter the proper connection URL in the Connection String field in the Database Configuration dialog box to establish connection with your SQL Server.

Establish connection with connection string
Establish connection with connection string

Diagnose Connection Issue in Command Line

You can diagnose whether your SQL Server is ready for making connection by using Telnet command. For Microsoft Windows, Telnet is not installed by default, you need to install it before running the telnet command.

Install Telnet Client

To install the Telnet client on your Windows:

Open Control Panel from the Start.

Open Control Panel
Open Control Panel

Select Programs and Features in the Control Panel.

Select Programs and Features
Select Programs and Features

Under Programs and Features, select Turn Windows features on or off.

Turn on Windows features
Turn on Windows features

Scroll down to find the option Telnet Client, check this option and press OK.

Turn on Telnet command
Turn on Telnet command

Use Telnet Command to Check is SQL Server Ready for making TCP/IP connection

Enter telnet %host% %port% in the command prompt, where %host% and %port% are the host and port of your SQL Server.

Telnet to SQL Server
Telnet to SQL Server

Press Enter to see if it can call the SQL Server. If the telnet can communicate with the host and port you have specified, a blank dialog box will be shown. This means your SQL Server is able to be connected.

Telnet successfully connect to SQL Server
Telnet successfully connect to SQL Server

If it fails to connect to your SQL Server, there will be a message of failure.

Telnet fail to connect to SQL Server
Telnet fail to connect to SQL Server

If you still fail to connect to SQL server with all the above steps of checking, please contact Visual Paradigm Support Team for technical support.

Share this