rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
607 stars 189 forks source link

Problems connecting to Azure from Windows #81

Closed MikeEmery closed 12 years ago

MikeEmery commented 12 years ago

I've got a dead simple script that is failing to connect.

require 'tiny_tds'
client = TinyTds::Client.new(
  :username => 'foo', 
  :password => 'bar', 
  :host => 'foobar.database.windows.net',
  :database => 'mydatabase_production', 
  :azure => true)

I get this error whenever I run it.

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds/client.rb:68:in `connect': Adaptive Server connection failed (TinyTds::Error)

I am able to connect to the Azure database ok using SQL Management Studio. Any tips you can offer would be greatly appreciated.

luislavena commented 12 years ago

Hello,

I believe that to connect so Azure you need a TinyTDS build that links to OpenSSL, as SSL is required for a secure connection, see Issue #75 and #74

MikeEmery commented 12 years ago

It is my understanding that TinyTDS 0.5.1 on Windows doesn't require anything special to be done http://groups.google.com/group/rails-sqlserver-adapter/browse_thread/thread/af1eeff685797567?hl=en#.

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds

"Start off by installing the gem. If you are on Windows, we precompile binaries for Ruby 1.8.7 and 1.9.2 for x86-mingw32. The precompiled gem includes the latest static version of FreeTDS too, so no compilation is needed. If you are not on Windows, installing the TinyTDS gem will require that you have FreeTDS installed and available in your PATH."

luislavena commented 12 years ago

@MikeEmery 0.5.1 solves the issue around configuration file, not secure connection (SSL) provided by OpenSSL, but leaving to @metaskills to comment.

I promised him to solve that issue but not enough time for OSS the past few weeks.

MikeEmery commented 12 years ago

Ahhhh, ok. Thanks for the clarification.

metaskills commented 12 years ago

Yea,@luislavena is bung on the pre compiled Windows binary can not connect to Azure. I'll close this and you can follow either #75 or #74 for updates.