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.
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 & Credentials]()
7) 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 Successful]()
9) 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. :-)
Comments (4)
Commented:
it's voila actually :)
Good article, does this work with mysql too?
Regards.
Author
Commented:And yes this does work for mySQL too as long as you have the driver for it.
Commented:
"Yes" vote above.
[BTW "Viola" (not voila) was a favorite expression of "Alfalfa" in the Little Rascals series. He wasn't too smart, but he sure could sing.]
Commented: