Friday, November 03, 2006

How to find database connection strings

When ever we create an application which has to be connected to a database, it needs a connection string. We all know the connection strings for widely used databases like SQL Server, MS Access, Oracle. If not we will find it in web. Then, how to find connection strings for less popular or rarely used databases. Yes you can.

Step 1: Open a notepad application
Step 2: Save the empty file with any name with udl extension (*.udl). Type the filename with extension with in quotes. Step 3: Double click the saved file.
Step 4: It will have 4 tabs (Provider, Connection, Advanced, All). Select "Provider" tab
Step 5: Select the provider. (To connect a database we need a driver or provider. If it is installed in the machine, it will be displayed in the Provider tab) and click Next. For Ex: Microsoft OLE DB for SQL Server
Step 6: Fill the appropriate information in the Connection tab, such as server name, username, password, database. Check the "Allow saving password" option. After filling the information click "Test Connection". It should pop up with the information"Test Connection succeeded".
Step 7: Click "Ok" to close the window. Click "Yes" for the next dialog.
Step 8: Now open the file in notepad. You will get the connection string.

No comments: