views:

210

answers:

2

What is the path of least resistance in getting an SBCL application running on Windows to connect to a SQL Server instance, using integrated authentication?

I have found posts on connecting from CL-SQL to SQL Server using ODBC connections but as far as I can tell, there is no way to this without first manually setting up a DSN.

Is there a simple way to accomplish this?

+2  A: 

There is a cl-mssql library that uses FreeTDS to communicate with MSSQL server. According to http://www.freetds.org/userguide/domains.htm, FreeTDS will use Integrated Authentication if you specify the login like 'DOMAIN\Username'. So it might work with cl-mssql (though I haven't used it).

dmitry_vk
I ran into some dll issues setting this up on Windows but I'd like to revisit this solution. In the meantime, I've successfully used plain-odbc as detailed separately for comment and future reference.
futuranon
+1  A: 

The path of least resistance for this (SBCL, Windows, no-DSN) seems to be plain-odbc.

(asdf:load-system :plain-odbc)
(use-package :plain-odbc)
(setf conn (connect-generic :driver "{SQL Server}"
                            :database "dbname"
                            :server "servername"
                            :trusted_connection "yes"))
(exec-query conn "select * from some_table")

Don't use (connect-sql-server ...) as it requires a default DSN, *default-sql-server-dsn*.

There may be a better driver to specify, as well.

futuranon