ODBC Connection

Hi,

I have an ODBC (sql server 2005) connection but recently I needed to
reconfigure the odbc to connect to another sql server, not the local
one.

Since then rubi cannot establish connection thru ODBC. If I reconfigure
the ODBC connection back to the local server it works fine.

Any idea what went wrong?

Thanks

Code:

def fetch(query)
ODBC::connect(‘odbc’, ‘user’, ‘password’) do |dbc|
stmt = dbc.run(query)
result_set = []
stmt.each do |row|
result_set << row
end
result_set
end
end

Israel T. wrote in post #1075534:

Hi,

I have an ODBC (sql server 2005) connection but recently I needed to
reconfigure the odbc to connect to another sql server, not the local
one.

Since then rubi cannot establish connection thru ODBC. If I reconfigure
the ODBC connection back to the local server it works fine.

Any idea what went wrong?

Thanks

Code:

def fetch(query)
ODBC::connect(‘odbc’, ‘user’, ‘password’) do |dbc|
stmt = dbc.run(query)
result_set = []
stmt.each do |row|
result_set << row
end
result_set
end
end

Do you have odbc resource defined in odbc connections.

I use tiny_tds GitHub - rails-sqlserver/tiny_tds: TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library. since it
doesn’t require any other local settings. And it works without problems
on Linux and Windows.

by
TheR