Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails and MS SQL EXPRESS

I want to develop a RoR application using MS SQL Express but I cannot figure out how to connect to the database. I tried

development:
adapter: sqlserver
database: historicDB
username: dxt
password: dxt
host: DBI:ADO:Provider=SQLNCLI;Data Source=localhost\SQLEXPRESS;InitialCatalog=historicDB;User Id=dxt;Password=dxt;

and

development:
adapter: sqlserver
database: historicDB
host: localhost\SQLEXPRESSS
username: dxt
password: dxt

I also installed dbi,dbd-odbc,activerecord-sqlserver-adapter but nowthing works I always get

   ActiveRecord::ConnectionNotEstablished

on the welcome screen

like image 219
Igor Kulman Avatar asked Jul 22 '26 17:07

Igor Kulman


1 Answers

First, use the TinyTDS gem and consult this page on using a named instance. https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds

You should be able to do this:

development:
  adapter: sqlserver
  database: historicDB
  dataserver: localhost\SQLEXPRESSS
  username: dxt
  password: dxt
like image 181
MetaSkills Avatar answered Jul 25 '26 10:07

MetaSkills