I'm using Tiny TDS in Windows 7 64bits.
Configs:
Ruby: 1.9.3
Rails: 4.0.0
Tiny TDS: 0.6.1
database.yml
development:
adapter: sqlserver
host: localhost
dataserver: PAVEI-PC\PAVEI
database: TKD_SUBD
username: pavei
password: pavei
in rails console
client = TinyTds::Client.new(:username => 'pavei', :password => 'pavei', :dataserver => 'PAVEI-PC\PAVEI', :database => 'TKD_SUBD')
irb(main):003:0* client.execute("teste")
TinyTds::Error: closed connection
from (irb):3:in `execute'
from (irb):3
I dont know why connection is closed!
Your configuration file is not right. As is mentioned in TinyTds Readme,
:host
must be used only if:dataserver
is blank, and you have both there. But the execution command in the console is correct.I have same problem, the connection is closed just after client is created, and this happens only when I use
:dataserver
instead:host
Works:
Doesn't work (connection is closed):