Skip to content

Commit 836714c

Browse files
authored
Merge pull request #9220 from MicrosoftDocs/OLEDB_Driver_Installation_Check_Pijocoder_062925
AB#6478 & AB#6479: Update ways to validate MSOLEDBSQL is present
2 parents c067108 + 6e63e4e commit 836714c

4 files changed

Lines changed: 129 additions & 70 deletions

File tree

16.1 KB
Loading

support/sql/database-engine/connect/test-oledb-connectivity-use-udl-file.md

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Test OLE DB connectivity to SQL Server by using a UDL file
33
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
55
ms.custom: sap:Database Connectivity and Authentication
66
author: HaiyingYu
77
ms.author: haiyingyu
@@ -25,15 +25,15 @@ To create a UDL file to test your OLE DB provider, follow these steps:
2525

2626
1. To show file extensions in File Explorer, follow these steps:
2727

28-
1. Select **Start**, and enter *File Explorer Options*.
28+
1. Select **Start**, and enter _File Explorer Options_.
2929

3030
1. Select the **View** tab, uncheck the **Hide extensions for known file types** option, and then select **OK**.
3131

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_.
3333

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.)
3535

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.
3737

3838
```Powershell
3939
clear
@@ -45,22 +45,22 @@ To create a UDL file to test your OLE DB provider, follow these steps:
4545
Invoke-Expression ($env:temp + "\sqlconn.udl")
4646
```
4747
48-
## Test the connection by using the SQL Server OLE DB provider
48+
## Test the connection by using the SQL Server OLE DB driver
4949
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.
5151
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.
5353
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:
5555
56-
1. Open the *.udl* file.
56+
1. Open the UDL file.
5757
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**.
5959
6060
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`.
6161
6262
> [!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.
6464
6565
1. Enter other properties on the **Connection** tab.
6666
@@ -75,7 +75,7 @@ You can also select other tabs and explore other driver settings. When the conne
7575
7676
To test Open Database Connectivity (ODBC) drivers by using Microsoft OLE DB Provider for ODBC Drivers, follow these steps:
7777
78-
1. Open the *.udl* file.
78+
1. Open the UDL file.
7979
8080
1. Select **Provider** > **Microsoft OLE DB Provider for ODBC Drivers** > **Next**.
8181
@@ -100,10 +100,62 @@ To test the connection of 32-bit providers in 64-bit operating systems, follow t
100100
1. Run the following command to open the UDL file:
101101
102102
```console
103-
c:\temp\test.udl
103+
C:\temp\test.udl
104104
```
105105
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`):
115+
116+
`Rundll32.exe "C:\Program Files\Common Files\System\OLE DB\oledb32.dll",OpenDSLFile C:\temp\test.udl`
117+
118+
- For 32-bit providers on 64-bit operating systems, use the following command:
119+
120+
`C:\Windows\SysWOW64\Rundll32.exe "C:\Program Files (x86)\Common Files\system\Ole DB\oledb32.dll",OpenDSLFile C:\temp\test.udl`
121+
122+
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.
127+
128+
[!INCLUDE [registry-important-alert](../../../../includes/registry-important-alert.md)]
129+
130+
1. Copy the following script to Notepad and save it as _udl32.reg_.
131+
132+
```output
133+
Windows Registry Editor Version 5.00
134+
135+
[HKEY_CLASSES_ROOT\.UDL32]
136+
@="ft000001"
137+
138+
[HKEY_CLASSES_ROOT\ft000001]
139+
@="Microsoft Data Link 32"
140+
"BrowserFlags"=dword:00000008
141+
"EditFlags"=dword:00000000
142+
143+
[HKEY_CLASSES_ROOT\ft000001\shell]
144+
@="open"
145+
146+
[HKEY_CLASSES_ROOT\ft000001\shell\open]
147+
148+
[HKEY_CLASSES_ROOT\ft000001\shell\open\command]
149+
@="C:\\Windows\\SysWOW64\\Rundll32.exe \"C:\\Program Files (x86)\\Common Files\\system\\Ole DB\\oledb32.dll\",OpenDSLFile %1"
150+
151+
[HKEY_CLASSES_ROOT\ft000001\shell\open\ddeexec]
152+
```
153+
154+
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.":::
107159

108160
## Tips to troubleshoot connection issues
109161

@@ -121,4 +173,4 @@ For each of the above methods, if one combination works and another fails, it co
121173
[Universal Data Link (UDL) configuration](/sql/connect/oledb/help-topics/data-link-pages)
122174

123175
> [!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

Comments
 (0)