This tip has been around a while, but I still run into developers who don’t know it, so it’s worth a post.
If you ever need to test connectivity or compose a valid OLEDB connection string, try this:
- Create an empty text file.
- Rename the extension from TXT to UDL
- Double click this file. The Data Link Utility appears
- Back up to the Provider tab, make sure you have the correct Provider selected
- Fill in the correct Connection information
- Click “Test Connection”
This is a good way to remove many of the variables associated with connectivity, and focus just on the data connectivity and security context.
And there’s an additional benefit – this UDL file is simply a specialized text file that contains an OLE-DB connection string. You can open up this file using any text editor.