Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection String tool 1

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
US
Someone posted a very clever way to create a connection string by creating a text file and then renaming it with a different file extension?

I can't remember the details. Does anyone know about this?

Thanks for any help.
 
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

Save as a .vbs file

 
You are referring to a file with a .udl extension.

On the desktop, create a new text file with the .udl extension. Double click it. After creating the connection string, you can right click the udl file and open with notepad.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
You are welcome. Someone, not sure who, posted that, and I saved it. So the credit goes to the orignal author.

George that is a cool way too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top