Ruby Connecting to SQL Server 2005

I want to connect to sql 2005 / db server with ODBC through ruby โ€‹โ€‹using windows authentication. I have the dbi-0.4.1 and dbd-odbc-0.2.4 gems installed. What do I need to do for the connection string? So far I have not been able to get it to work.

DBI.connect ("DBI: ODBC: Data Source = # {server}; Integrated Security = SSPI; Start Directory = # {db}")

+3
source share
2 answers

Appears after specifying DBI: DriverName: you can specify any available connection information.

DBI.connect ("DBI: ODBC: Driver = {SQL Server}; Server = # {server}; Database = # {db}; Trusted_Connection = yes")

http://www.devlist.com/ConnectionStringsPage.aspx

+1

:

DBI.connect( 'DBI: ODBC: ')

0

Source: https://habr.com/ru/post/1706113/


All Articles