There are three significant aspects that uses may neglect, leading the failure of the connection to the SQL Server.
Server Settings
Enable TCP/IP
- Open your SQL Server Configuration Manager.
- Expand SQL Server Network Configuration and select Protocols for SQLEXPRESS.
- 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.
- 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.
- Click the IP Address tab in the TCP/IP Properties dialog box.
- Under IPAll section, you can see the TCP Port (default: 1433) and you can edit the port of your server.
Correct Hostname and Port
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 > Object-Relational Mapping (ORM) > Database Configuration in the VP application.
- Select the Language, server and the driver in the Database Configuration dialog box.
- Enter Hostname, which must be either the IP address of your computer or your computer name.
- 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.
Allow Remote Connection
Your need to make sure that remote connection to your SQL Server is enabled.- Startup your SQL Server.
- Right-click on the server and select Properties in the popup menu.
- In the Server Properties dialog box, select Connections.
- Check the checkbox of Allow remote connections to this server.
Diagnosis of Connection in Command Line
You can diagnose whether your SQL Server is in-use by the command line. For Windows Vista, Telnet is not installed by default, you need to install it before running the telnet command.Install Telnet Client in Windows Vista
- Open Control Panel from the Start Menu.
- Select Programs in the Control Panel.
- Under Programs and Features, select Turn Windows features on or off.
- Scroll down to find the option Telnet Client, check this option and press OK.
Run Telnet Command
- Shutdown your SQL Server first and launch the command prompt.
- Enter telnet %host% %port% in the command prompt, where %host% and %port% are the host and port of your SQL Server.
-
Press Enter to see if it can call the SQL Server. If telnet can
communicate with the host and port you specified, it will show a blank
dialog box. This means your SQL Server is able to be connected.
If it fails to connect to your SQL Server, there will be message of the failure.
Authentication Method
Make sure that you are using the appropriate authentication method in connecting to your SQL Server.- Startup your SQL Server.
- Right-click on the server and select Properties in the popup menu.
- In the Server Properties dialog box, select Security.
- Normally, the Server Authentication is set to SQL Server and Windows Authentication Method.
-
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://localhost;databaseName=AdventureWorks;integratedSecurity=true; -
Java (jDTS)
jdbc:jtds:://[:][/];domain=XXX
where= 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%
-
Java (SQL Server 2005 Microsoft Driver)
- Get back to the VP application and enter the URL in the Connection String section in the Database Configuration dialog box.
Adapter File
While you are using can 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 > Object-Relational Mapping (ORM) > Database Configuration.
- After you have chosen the language, server and driver, click the Download and Update button beside the Adapter file field.
- VP will download the adapter file for you.
EmoticonEmoticon