Topic: Windows Server 2003 and SQL Server 2005

I'm using a remote SQL Server 2005 and RoR running on my desktop (WEBrick) to develop my application. To get RoR to work with SQL Server I followed the instructions on the RoR Wiki (http://wiki.rubyonrails.org/rails/pages … tSQLServer). This works perfectly.

For testing I'd like to move the application to a server (Windows Server 2003). InstantRails (http://instantrails.rubyforge.org/) seemed like the easiest way to do this. I installed it as per the instructions and deployed my application. I started the application with Mongrel but I got the following error as soon as I tried to visit any page.

Open
    OLE error code:800A0E7A in ADODB.Connection
      Provider cannot be found. It may not be properly installed.
    HRESULT error code:0x80020009
      Exception occurred.

It appears that the application is unable to connect to the database. Does anyone know what is going on here?

database.yml wrote:

development:
  adapter: sqlserver
  database: database
  username: user
  password: pass
  host: 192.168.0.XXX

I also tried localhost as the host.

Re: Windows Server 2003 and SQL Server 2005

Did you set up the SQL Server adapter on your testing server as well?

You may also have to install Microsoft Data Access Components (MDAC) on your server. A quick search on Microsoft's site should provide you with the download.

vinnie - rails forum admin

Re: Windows Server 2003 and SQL Server 2005

vin wrote:

Did you set up the SQL Server adapter on your testing server as well?

What's "SQL Server adapter"? I didnt install this on my desktop.

vin wrote:

You may also have to install Microsoft Data Access Components (MDAC) on your server. A quick search on Microsoft's site should provide you with the download.

Cheers. I'll take a look.

Re: Windows Server 2003 and SQL Server 2005

If I follow the instructions on the RoR Wiki (http://wiki.rubyonrails.org/rails/pages … tSQLServer) [i]Newbie

Re: Windows Server 2003 and SQL Server 2005

.\SQLEXPRESS is the name of the SQL Server (in this case, sql 2005 express edition) instance installed on the computer.

vinnie - rails forum admin

Re: Windows Server 2003 and SQL Server 2005

vin wrote:

.\SQLEXPRESS is the name of the SQL Server (in this case, sql 2005 express edition) instance installed on the computer.

I thought as much thanks. Is it the name of the specific version or the name of all installations of "sql 2005 express edition"?

Edit: The name of my SQL Server appears to be WIN-SERVER-1. So I should be able to replace  ./SQLEXPRESS with ./WIN-SERVER-1?

Last edited by mip (2006-10-10 09:55:31)

Re: Windows Server 2003 and SQL Server 2005

mip wrote:
vin wrote:

.\SQLEXPRESS is the name of the SQL Server (in this case, sql 2005 express edition) instance installed on the computer.

I thought as much thanks. Is it the name of the specific version or the name of all installations of "sql 2005 express edition"?

The specific instance. You can change the instance name somehow but I forget (either some hard-to-find option or at install time) but .\SQLEXPRESS is the default.

mip wrote:

Edit: The name of my SQL Server appears to be WIN-SERVER-1. So I should be able to replace  ./SQLEXPRESS with ./WIN-SERVER-1?

Yes.

vinnie - rails forum admin

Re: Windows Server 2003 and SQL Server 2005

vin wrote:
mip wrote:

Edit: The name of my SQL Server appears to be WIN-SERVER-1. So I should be able to replace  ./SQLEXPRESS with ./WIN-SERVER-1?

Yes.

Still no joy.

I'm getting:

Open
    OLE error code:80004005 in Microsoft SQL Native Client
      Unable to complete login process due to delay in opening server connection
    HRESULT error code:0x80020009
      Exception occurred.

Re: Windows Server 2003 and SQL Server 2005

I've made the following changes to sqlserver_adapter.rb:

Added:

provider = config[:provider] ? config[:provider].to_s : 'SQLOLEDB'

and modified line 39 to:
driver_url = "DBI:ADO:Provider=#{provider};Data Source=#{host};Initial Catalog=#{database};User Id=#{username};Password=#{password};"

With:

development:
  adapter: sqlserver
  database: database
  username: username
  password: password
  host: .
  mode: DBI:ADO
  provider: SQLNCLI

I get:

Open
    OLE error code:80004005 in Microsoft SQL Native Client
      Unable to complete login process due to delay in opening server connection
    HRESULT error code:0x80020009
      Exception occurred.

and with:

development:
  adapter: sqlserver
  database: database
  username: username
  password: password
  host: .\WIN-SERVER-1
  mode: DBI:ADO
  provider: SQLNCLI

I get:

Open
    OLE error code:80004005 in Microsoft SQL Native Client
      SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
    HRESULT error code:0x80020009
      Exception occurred.

Last edited by mip (2006-10-11 07:44:58)

10

Re: Windows Server 2003 and SQL Server 2005

Anyone got any idea what's going on here? It's driving me mad!

Anyone got Rails working with SQL Server 2005?

11

Re: Windows Server 2003 and SQL Server 2005

Got it working! smile

Found the solution here http://blogs.msdn.com/sql_protocols/arc … 83684.aspx

I need to use 127.0.0.1 as the host.

Re: Windows Server 2003 and SQL Server 2005

Hi
I'm following the "depot" example in the book Agile web development with rails. I successfully create the table products.But when it comes to insert value into the table.It has the following error message

    DBI::DatabaseError: Execute
    OLE error code:80040E14 in Microsoft SQL Native Client
        syntax close to ')' is incorrect
    HRESULT error code:0x80020009
      Exception : INSERT INTO products () VALUES()

I check the sql database. I found only the table is created, there are no columns. Anyone knows what might cause this?
Thanks in advance.

Re: Windows Server 2003 and SQL Server 2005

When you say there are no columns, are there columns in the table itself? Or do you mean no rows/entries?

Can you post more code? The ruby code you use to create the product and any code you might have used to generate the products table.

Railscasts - Free Ruby on Rails Screencasts

Re: Windows Server 2003 and SQL Server 2005

Tables are created but no columns.
The code is here

Re: Windows Server 2003 and SQL Server 2005

Did you run this command?

rake db:migrate

This should run the migrations and add any columns.

Railscasts - Free Ruby on Rails Screencasts