Tuesday, March 24, 2009

SQL connection string made easy

I came across this a few times while fighting with attempts to access the ACT! database. I wanted to try a few different connection strings in Sharepoint Designer. Found an easy way to make one:

1. On your desktop, right-click and choose New > Text Document.
2. Give it a name, and save it with an extension of .UDL. It will now have a fancy icon.
3. Right-click properties the doc you just created.
4. Enter the type of connection. I chose OLE DB for SQL. Enter server name (with \instancename, if required). Enter username/pw info, etc. Click Apply. Click Ok.
5. Open notepad.
6. Drag the UDL icon document you created onto notepad. It will expose the full connection string.

Here is what mine looked like:

[oledb]
Provider=SQLOLEDB.1;Password=ChangeMe;Persist Security Info=True;User ID=ActReader;Initial Catalog=ACT2009TestDB;Data Source=mydatabasesevername\ACT7

No comments:

Post a Comment