This is not directly related to .NET but there have been so many users with errors in their connection string that this may be of some use.
Method 1 If you paste the following into a text file but save it with a vbs extension you can connect to any database and it will give you the connection string you need:
Dim objDataLinks, strRetVal Set objDataLinks = CreateObject("DataLinks") On Error Resume Next ' ignore cancel strRetVal = objDataLinks.PromptNew On Error Goto 0 If Not IsEmpty(strRetVal) Then InputBox "Your Connection String is listed below.", _ "OLE DB Connection String", strRetVal End If Set objDataLinks = Nothing
Method 2 Thanks to henslecd for the following alternative:
Another thing that you can do is right click on your desktop and choose to create a new text file. Rename the file's extension to .udl, such as conn.udl . Open the conn.udl file, choose the correct provider from the provider tab. Depending on the provider chosen, you will be given different set of choices in the connection tab. Enter in the info that corresponds to the DB you are connecting to. Test the connection. If it works, close conn.udl. Right click on the udl file, and choose to open it with NotePad. You will then see the proper connection string to use.