How to Use ODBC Driver to Test Connection to a MS SQL Server

Photo of author

By Victor Ashiedu

Published

If you have an app connecting to a Microsoft SQL data source, you may need to confirm that the source (app)  server can successfully connect to the SQL server.

This guide teaches you the two methods for performing this test.

Option 1: Test Connection with ODBC Data Sources Driver

Microsoft provides an app on every Windows computer for making SQL test connections. The app is called “Set up ODBC data sources”.

Here are the steps to use this app to test whether you can successfully connect to a Microsoft SQL server.

  1. Sign in to the server or computer you’re testing the connection from. Then, search for and open the Control Panel.
  2. When Control Panel opens, search odbc and open “Set up ODBC data source” – there is a 32-bit and 64-bit version – select the one you want to use. 
Test Connection with ODBC Data Sources Driver 1
  1. When the ODBC Data Source Administrator opens, click the System DSN tab. Then, click Add.
Test Connection with ODBC Data Sources Driver 2
  1. Select SQL Server and click Finish.
  1. Enter a name for the connection in the Name field. Then, enter the name or IP address of the Microsoft SQL server you want to connect to in the Server field – click Next to continue.
  1. Finally, select the credential type to use for the connection and click Next.
The first option, “With Windows NT authentication…” connects to the SQL server using the logged-in credential. On the other hand, option 2, “With SQL Server…” connects with an SQL login. If the connection is successful, you will receive a confirmation
Finally, select the credential type to use for the connection and click Next.

Option 2: Test SQL Connection Using a .udl File

If you do not want to use the inbuilt ODBC connector app, you can create any file name with the .udl extension. Then, use the file to test your connection.

The three subsections below explain the detailed steps.

Step 1: Change File Explorer Settings

  1. Right-click the Windows Start menu and select File Explorer.
  1. Click the View tab, then the Options drop-down, and select “Change folder and search options.”
  1. Finally, on the Folder Options screen, click the View tab and uncheck the Hide extensions for known file types option – then click OK.

Step 2: Create a .udl File

  1. From the computer you want to test the connection from, open Notepad. Then, click File -> Save As.
Test SQL Connection Using a .udl File
  1. Next, select the folder you want to save the file. Then, enter any name with the .udl extension.

    You MUST enter the name in double quotation marks. Here is a sample that I am using for my demonstration. Finally, click Save to save the file.
"SQLconnection.udl"

Step 3: Test an SQL Connection Using the .udl File

  1. Open the location you saved the file in step 1 and double-click it.
Step 3: Test an SQL Connection Using the .udl File
  1. On the “Data link properties” settings that open, enter the name or IP address of the SQL server. Then, select the login type and enter the sign in credentials.

    After entering the details, click “Test Connection.”
The first option, “Use Windows NT Integrated security” connects to the SQL server using the logged-in credential. The second option, “Use a specific user name and password” allows you to specify a different username and password.

Conclusion

Testing connections to a Microsoft SQL database server is an essential troubleshooting step in trying to figure out why an app may be having trouble working as expected. I have shown two methods to complete this essential troubleshooting step in this guide.

Specifically, I explained how to test a Microsoft SQL connection using the built in ODBC Data Sources Driver and by using a .udl file.

Let me know the method you preferred using the “Was this page helpful?” question below.

Before you run, you may benefit from browsing our Windows Server how-to guides page.

About the Author

Photo of author

Victor Ashiedu

Victor is the founder of InfoPress Media, publishers of Ilifeguides and Itechguides. With 20+ years of experience in IT infrastructure, his expertise spans Windows, Linux, and DevOps. Explore his contributions on Itechguides.com for insightful how-to guides and product reviews.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment

Send this to a friend