views:

744

answers:

1

Alright. While there are a few blog posts here and there purporting to make this process easy, this is absolutely driving me crazy.

Here's what I've done:

  • I've installed FreeTDS (with and without +mssql) but encounter problems when I use it to connect to my remote DB instance. When I attempt

    tsql -H [remote-db-ip] -p 1433 -U [valid-username]

    I am informed (after a minute or so) that Tsql was unable to connect, because Adaptive Server is unavailable or doesn't exist.

  • Installed the Actual driver. Created a user-level DSN through ODBC administrator which "successfully" connects to my remote SQL server (even acquiring correct DB version.) However, when I try to test it through iODBC it says:

    [Actual][SQL Server] Unable to connect to data source (0) SQLSTATE=08001

  • Installed DBI (0.4.1) and DBD:ODBC (0.2.4) gems. Encounter the same error if I try to connect through irb.

  • Installed rails-sqlserver-2000-2005-adapter (2.2.19). Checked out my Rails application and ran script/server. Setup my database.yml to the same values that work to remote connect on my windows development machine. Appears to startup alright, but I encountered the same error when I try to navigate to the app's homepage.

Thanks, and please let me know if I've left some extremely obvious step! This is killing me.

+1  A: 

I've used these directions in the past and it's working flawlessly - give it a shot and let me know where you get hung up: http://toolmantim.com/articles/getting%5Frails%5Ftalking%5Fto%5Fsqlserver%5Fon%5Fosx%5Fvia%5Fodbc

You certainly need FreeTDS if you haven't installed it yet.

John Pignata
Thanks for your advice. I've installed FreeTDS (with and without +mssql) but encounter problems when I use it to connect to my remote DB instance. When I attempt tsql -H <remote_db_ip> -p 1433 -U <valid_username> I am informed (after a minute or so) that Tsql was unable to connect, because Adaptive Server is unavailable or doesn't exist. Note that I'm successfully connecting -- even acquiring the correct database version -- when I run the configuration tests on the DSN through ODBC administrator using the Actual driver...
Joe
Hmm. One other thing: In order to actually connect to my SQL box, I need to run:TDSVER=7.0 tsql -H [hostname] -p 1433 -U [user] -P [pass]with the environment variable I get:Unexpected EOF from the serverMsg 20002, Level 9, State -1, Server OpenClient, Line -1Adaptive Server connection failedThere was a problem connecting to the server
John Pignata
Doesn't seem to help (tried versions 6 and 8 as well)...
Joe
Bummer. And if you telnet to the host on port 1433, you resolve it and connect with no problem?
John Pignata
That was it, some network settings on the server which needed to be cleaned up...Thanks!
Joe
The link above is now broken. Does anyone have a link to a similar tutorial?
Matt Campbell