INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Database

Connection Strings by ca8msm
Posted: 28 Mar 05 (Edited 18 Aug 06)

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:

CODE

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.

Method 3
http://www.codeproject.com/cs/database/DataLinks.asp

Method 4
http://www.connectionstrings.com

Back to Microsoft: ASP.NET FAQ Index
Back to Microsoft: ASP.NET Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close