- Create empty txt file, e.g: test.txt.
- Change file extension from *.txt to *.udl. If file name is shown without extensions, open file, press File > Save As and change extension in ‘File name’ textbox, press save.
- Open newly created *.udl file.
- Fill connection settings, after filling fields you can press ‘Test connection’ to make sure that all parameters are correct and press Ok.
- Open *.udl file with notepad and it will contain connection string. e.g:
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=AdventureWorks2012;Data Source=.
Note: Provider in generated connection string is really old and rarely used, It’s best just to remove that part (Provider=SQLOLEDB.1;).