1. Create empty txt file, e.g: test.txt.
  2. 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.

  3. Open newly created *.udl file.
  4. Fill connection settings, after filling fields you can press ‘Test connection’ to make sure that all parameters are correct and press Ok.

  5. 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;).


Comments are closed