in reply to user and system DSN
Where possible, I use DSN-less connections to avoid the administrative overhead of setting up and maintaining the DSNs. If you use DSN-less connections, make sure your connection strings can easily be updated (i.e. don't hard code them in many places throughout your code).
Where DSNs are necessary, I generally use system DSNs but if the application and system are administered by different teams, coordinating changes can be problematic, depending on how well the teams work together.
I have used Win32::OLE to instantiate an "ADODB.Connection" object with "Provider=sqloledb" in the past. This doesn't require a DSN. If I wanted to use DBI, I would probably investigate DBD::ADO, but I haven't used it thus far. I don't often connect Perl applications to SQL Server.
You can find and set all the system and user DSNs in the registry. I don't know if there are other interfaces, but I have found direct manipulation of the registry easy enough for SQL Server connections that I have never bothered to find any other way of setting them up programmatically. To find user DSNs for users other than the currently logged on user you will have to search through the HKEY_USERS hive.
|
|---|