User Tools

Site Tools


windows:connectdatabaseusingodbcwithoutdsn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
windows:connectdatabaseusingodbcwithoutdsn [2015/06/04 10:10]
rlunaro [Step 1: create a ''test.udl'' for the test]
windows:connectdatabaseusingodbcwithoutdsn [2015/06/04 10:25] (current)
rlunaro [Step 2: open it and pick an OLE DB provider]
Line 23: Line 23:
 for ODBC Drivers":​ for ODBC Drivers":​
  
-{{ :​windows:​20150604_step_2.png?​direct&​200 ​|}}+{{ :​windows:​20150604_step_2.png?​direct |}} 
 + 
 +===== Step 3: create a new connection string ===== 
 + 
 +Click on "Use connection string"​ and then on "​Build...":​ 
 + 
 +{{ :​windows:​20150604_step_3.png?​direct |}} 
 + 
 +In the window that will appear, select "​New":​ 
 + 
 +{{ :​windows:​20150604_step_4.png?​direct |}} 
 + 
 +Pick the ODBC driver you want to use: 
 + 
 +{{ :​windows:​20150604_step_5.png?​direct |}} 
 + 
 +Windows will request you to save this file as a "​something.dsn"​ file. Select a file; it can be deleted afterwards:  
 + 
 +{{ :​windows:​20150604_step_6.png?​direct |}} 
 + 
 +After that, some configuration parameters that are specific for the driver will be requested. Because I've  
 +the Microsoft for Oracle Driver, the usual screen requesting TNS, username and password is shown. In other  
 +drivers, other screens will appear. 
 + 
 +{{ :​windows:​20150604_step_7.png?​direct |}} 
 + 
 +You will see that after this step the important information of the connection string is fullfilled:  
 + 
 +{{ :​windows:​20150604_step_8.png?​direct |}} 
 + 
 +Fulfill the username, password and click on "Allow saving password":​  
 + 
 +{{ :​windows:​20150604_step_9.png?​direct |}} 
 + 
 +Save all the information and close the window. 
 + 
 +===== Step XX: open the udl file with a text editor ===== 
 + 
 +After that, open the ''​*.udl''​ file with a text editor. You will see something like that:  
 + 
 +<​code>​ 
 +[oledb] 
 +; Everything after this line is an OLE DB initstring 
 +Provider=MSDASQL.1;​Password=YOUR-PASSWORD-HERE;​Persist Security Info=True;​User ID=YOUR-USERNAME-HERE;​Extended Properties="​DRIVER={Microsoft ODBC for Oracle};​UID=YOUR-USERNAME-HERE;​PWD=YOUR-PASSWORD-HERE;​SERVER=YOUR-TNS-HERE"​ 
 +</​code>​ 
 + 
 +You can use that as a connection string for your ADODB.connection objects and it won't need any DNS  
 +for connection.  
 + 
 + 
 + 
 + 
  
 ===== Step 3: move back to "​connection"​ and create a new connection string ===== ===== Step 3: move back to "​connection"​ and create a new connection string =====
windows/connectdatabaseusingodbcwithoutdsn.txt · Last modified: 2015/06/04 10:25 by rlunaro