<

Get your database connection string in seconds

Published on
13,873 Points
3,373 Views
10 Endorsements
Last Modified:
Awarded
Have you ever wanted a quick way to get the connection string for your database?  I use this all the time whenever I am doing web development or Access programming and need to get any connection string in a jiffy.


1)  Create a new text document on your desktop and just call it "test.txt".

2)  Rename the document and change the extension to "test.udl".

3)  It will ask you if you are sure you want to change the extension, just click "OK".

4)  Double click on the newly renamed file and it will open up a window for "Data Link Properties" and in here you can easily enter all the information needed to access your database.

5)  Click the "Provider" tab on the upper left and select from the list of providers what kind of database you want to connect to.  
Selecting Your Database Type (Provider)NOTE:  If the type of database you want to connect to is not listed then the computer you are on does not have the driver for that database installed.  This is also a great troubleshooting step that you can detect early if you can't connect using a pre-existing connection string.

6)  Then click the "Connection" tab and enter the server name or IP address of the server it resides on.  The layout of this tab varies based upon the database provider you choose but the basics are the same.  
Entering Database Properties & Credentials7)  Enter any credentials needed to access the database and check the box for "Allow password saving" if you want the connection string to contain the password.

8)  Click the "Test Connection" button to make sure you've entered everything correctly and if it does not come back successful then you need to recheck your entries and try again.
Connection String Test Successful9)  Click "OK" to close the window and get back to your original file.  Right click and select "Rename" and change the file extension back to "test.txt".

NOTE:  If you selected "Save password" then you will get a prompt asking if you are sure because it will be stored as plain text, just click "Yes".

10)  Open the newly renamed "test.txt" file and voilĂ !  Your full connection string is the last line in the file.  You can simply copy/paste into any application you are working in.


Enjoy.   :-)
Finished Connection String in Notepad
10
Author:tphelps19
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Get 7 days free