You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/sql/database-engine/connect/test-oledb-connectivity-use-udl-file.md
+68-16Lines changed: 68 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Test OLE DB connectivity to SQL Server by using a UDL file
3
3
description: Describes how to create a UDL file and use it to test OLE DB connectivity to SQL Server.
4
-
ms.date: 01/17/2025
4
+
ms.date: 07/01/2025
5
5
ms.custom: sap:Database Connectivity and Authentication
6
6
author: HaiyingYu
7
7
ms.author: haiyingyu
@@ -25,15 +25,15 @@ To create a UDL file to test your OLE DB provider, follow these steps:
25
25
26
26
1. To show file extensions in File Explorer, follow these steps:
27
27
28
-
1. Select **Start**, and enter *File Explorer Options*.
28
+
1. Select **Start**, and enter _File Explorer Options_.
29
29
30
30
1. Select the **View** tab, uncheck the **Hide extensions for known file types** option, and then select **OK**.
31
31
32
-
1. Navigate to the folder where you want to create a UDL file. For example, *c:\\temp*.
32
+
1. Navigate to the folder where you want to create a UDL file. For example, _C:\\temp_.
33
33
34
-
1. Create a new text file (such as *sqlconn.txt*), and then rename the extension from *.txt* to *.udl*. (Select **Yes** to the warning message about changing the file name extension.)
34
+
1. Create a new text file (such as _sqlconn.txt_), and then rename the extension from _.txt_ to _.udl_. (Select **Yes** to the warning message about changing the file name extension.)
35
35
36
-
You can also use the following PowerShell script to create *sqlconn.udl* in your *%temp%* folder.
36
+
You can also use the following PowerShell script to create _sqlconn.udl_ in your _%temp%_ folder.
37
37
38
38
```Powershell
39
39
clear
@@ -45,22 +45,22 @@ To create a UDL file to test your OLE DB provider, follow these steps:
45
45
Invoke-Expression ($env:temp + "\sqlconn.udl")
46
46
```
47
47
48
-
## Test the connection by using the SQL Server OLE DB provider
48
+
## Test the connection by using the SQL Server OLE DB driver
49
49
50
-
[Microsoft OLE DB Provider for SQL Server](/sql/connect/oledb/oledb-driver-for-sql-server) (SQLOLEDB) is the most common provider. It's built into Windows and can connect to any version of SQL Server that's not configured to require TLS 1.2 channel bindings.
50
+
[Microsoft OLE DB Driver for SQL Server](/sql/connect/oledb/oledb-driver-for-sql-server#1-microsoft-ole-db-driver-for-sql-server-msoledbsql-recommended) (MSOLEDBSQL) is the latest SQL Server OLE DB driver. The driver has new features, such as TLS 1.2 and 1.3, [MultiSubnetFailover](/dotnet/api/system.data.sqlclient.sqlconnectionstringbuilder.multisubnetfailover), and Azure authentication methods (Microsoft Entra ID). We recommend this driver for newer SQL Server databases.
51
51
52
-
[Microsoft OLE DB Driver for SQL Server](/sql/connect/oledb/oledb-driver-for-sql-server#3-microsoft-ole-db-driver-for-sql-server-msoledbsql) (MSOLEDBSQL) is the latest SQL Server OLE DB provider. The provider has all the new features, such as TLS 1.2, [MultiSubnetFailover](/dotnet/api/system.data.sqlclient.sqlconnectionstringbuilder.multisubnetfailover), and Azure authentication options. We recommend this provider for newer SQL Server databases.
52
+
[Microsoft OLE DB Provider for SQL Server](/sql/connect/oledb/oledb-driver-for-sql-server#3-microsoft-ole-db-provider-for-sql-server-sqloledb) (SQLOLEDB) is the legacy OLE DB connectivity provider. It's built into Windows and can connect to any version of SQL Server that's not configured to require TLS 1.2 or 1.3 channel bindings.
53
53
54
-
To test the connection by using the SQL Server OLE DB provider, follow these steps:
54
+
To test the connection by using the Microsoft OLE DB driver or provider for SQL Server, follow these steps:
55
55
56
-
1. Open the *.udl* file.
56
+
1. Open the UDL file.
57
57
58
-
1. Select the **Provider** tab, select the SQL Server OLE DB provider that you use in your application, and then select **Next**.
58
+
1. Select the **Provider** tab, select the OLE DB driver or provider that you use in your application, and then select **Next**.
59
59
60
60
1. On the **Connection** tab, specify the network protocol, the fully qualified domain name (FQDN), and the port number under **Select or enter a server name**. For example, `tcp:SQLProd01.contoso.com,1433`.
61
61
62
62
> [!NOTE]
63
-
> This way of entering the server name avoids some common issues (such as the SQL Server Browser service issues) that could interfere with a connection.
63
+
> This way of entering the server name and port avoids common issues (such as the SQL Server Browser service issues) that could interfere with a connection.
64
64
65
65
1. Enter other properties on the **Connection** tab.
66
66
@@ -75,7 +75,7 @@ You can also select other tabs and explore other driver settings. When the conne
75
75
76
76
To test Open Database Connectivity (ODBC) drivers by using Microsoft OLE DB Provider for ODBC Drivers, follow these steps:
77
77
78
-
1. Open the *.udl* file.
78
+
1. Open the UDL file.
79
79
80
80
1. Select **Provider** > **Microsoft OLE DB Provider for ODBC Drivers** > **Next**.
81
81
@@ -100,10 +100,62 @@ To test the connection of 32-bit providers in 64-bit operating systems, follow t
100
100
1. Run the following command to open the UDL file:
101
101
102
102
```console
103
-
c:\temp\test.udl
103
+
C:\temp\test.udl
104
104
```
105
105
106
-
1. If you see **Microsoft Jet 4.0 OLE DB Provider** on the **Provider** tab, that means you successfully loaded the 32-bit dialog and can now select the 32-bit provider to test the connection.
106
+
1. If you see **Microsoft Jet 4.0 OLE DB Provider** on the **Provider** tab, you successfully loaded the 32-bit dialog and can now select the 32-bit provider to test the connection.
107
+
108
+
## Launch a UDL file
109
+
110
+
Double-click a UDL file to launch it. The following describes the underlying process used when launching a UDL file.
111
+
112
+
The UDL file UI is provided by _OLEDB32.DLL_ and hosted in _RUNDLL32.EXE_.
113
+
114
+
- For 32-bit operating systems or for 64-bit providers on 64-bit operating systems, use the following command (assuming `C:\temp\test.udl`):
The _.udl_ file extension is mapped to the first command. For 32-bit providers on 64-bit operating systems, you can simplify things by running a 32-bit command prompt and then running `START C:\TEMP\TEST.UDL` to test 32-bit providers. Optionally, you can create a file extension mapping that uses the 32-bit command.
123
+
124
+
### Create a 32-bit UDL32 file extension mapping
125
+
126
+
If you frequently use 32-bit providers on a 64-bit operating systems, you can map a new file extension (for example, _.udl32_) to launch the 32-bit UDL dialog by using the following steps.
1. Double-click the _.reg_ file to create a registry key, which helps you automatically launch UDL32 files.
155
+
1. Create a file with the _.udl32_ file extension. For example, _C:\temp\test.udl32_.
156
+
1. Double-click the _test.udl32_ to launch the 32-bit UDL dialog. For example, you might see a dialog like this:
157
+
158
+
:::image type="content" source="media/test-oledb-connectivity-use-udl-file/32-bit-udl-dialog.png" alt-text="Screenshot shows an example of a 32-bit UDL dialog.":::
107
159
108
160
## Tips to troubleshoot connection issues
109
161
@@ -121,4 +173,4 @@ For each of the above methods, if one combination works and another fails, it co
121
173
[Universal Data Link (UDL) configuration](/sql/connect/oledb/help-topics/data-link-pages)
122
174
123
175
> [!NOTE]
124
-
> If this article hasn't resolved your issue, you can check [Troubleshoot connectivity issues in SQL Server](../connect/resolve-connectivity-errors-overview.md#common-connectivity-issues) for more help.
176
+
> If this article doesn't resolve your issue, you can check [Troubleshoot connectivity issues in SQL Server](../connect/resolve-connectivity-errors-overview.md#common-connectivity-issues) for more help.
0 commit comments