If all you''re using the MSSQL database for is a username and password,
you ought to make the MySQL database the primary database. In
database.yml, add configuration for your MSSQL server. It will look
something like:
mssql_connection:
adapter: sqlserver
database: dbmydatabase
host: sqlserver.domain.com
username: user
password: secret
Then, generate a model in your project and insert code akin to:
class LoginInfo < ActiveRecord::Base
set_table_name "user_info"
establish_connection :mssql_connection
def fetch_username
# code to get username here
end
def fetch_password
# code to get password here
end
end
Then you should be able to call UserInfo.fetch_username from within
your app and the username will be returned.
On Aug 27, 11:24 am, Joshua Thomas
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hello all, I''ve got a question. I''m writing a RoR app for
a client and
> they need me to use two databases, one a mssql database the other a
> mysql database. The mssql database will hold the username/password
> values. Once I connect to the mssql database, I''ll need to change
to
> another database to query the information in the reporting software. Any
> tips on configuring this?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---