Recently, I added support for SSPI (a connection that uses your local user account to authenticate you on the database server without supplying another password). To use an SSPI connection, do not supply a username or a password.
sqlserver_adapter.rb:
sqlserver_adapter.rb:
username = config[:username] ? config[:username].to_s : ''
...
# Use integrated security
if config[:integrated] or (username == '' and password == '')
conn = DBI.connect("DBI:ADO:Provider=SQLOLEDB;Data Source=#{host};Initial Catalog=#{database};Integrated Security=SSPI;")
else
conn = DBI.connect("DBI:ADO:Provider=SQLOLEDB;Data Source=#{host};Initial Catalog=#{database};User Id=#{username};Password=#{password};")
end
Comments