rails-sqlserver / tiny_tds

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

after new client, client is no active #64

Closed martinovallara closed 12 years ago

martinovallara commented 12 years ago

ramGISE = TinyTds::Client.new(:username => 'ruby',:password => 'ruby2011', :dataserver => 'localhost\SQLEXPRESS', :database => 'RAMGISE') => #TinyTds::Client:0x3005898 ramGISE.active? =>false

What's wrong? How can I find the configuration error?

luislavena commented 12 years ago

Dumb question: are you escaping the backlashes?

metaskills commented 12 years ago

The named instance with the backslash is technically a valid parameter for :dataserver, however I have never tested it. I think it requires the latest FreeTDS 0.91 and some special love in the freetds.conf file. If you are not able to get a connection established using it, then switch to a :host and :port setting instead. The host should be easy, but you have to dig into what port the named intense is running on.

martinovallara commented 12 years ago

Sorry but I am new to ruby.

Only now I had the impression that this gem is only usable in linux. I need to use it under windows. Is it possible?

metaskills commented 12 years ago

Welcome to Ruby :) Here are a few ways to help answer questions on your own in the future.

First, gems that have native C extensions (like tiny_tds) sometimes have platform specific version precompiled. You can easily tell this by visiting the gem on rubygems.org and clicking on all versions. Any platform specific gem will have some type of platform string at the end. If you look at our page https://rubygems.org/gems/tiny_tds/versions, you can see that we do have precompiled binaries for Windows, listed as "x86-mingw32". We also have TinyTDS bundled with the wonderful RailsInstaller project http://railsinstaller.org/. So long story short, just install the gem and you should be good to go.

Second, a projects README file https://github.com/rails-sqlserver/tiny_tds and sometimes their wiki pages have direct answers to most question. If you were to search it for "Windows" you may quickly see that indeed we are Windows tested. If that fails, a quick Google search should show the answer too http://bit.ly/rYg6Ax.

Cheers!