rails ODBC data source problem? - ruby-on-rails

Here's an odd situation, if I open a command prompt and start the mongrel server then everything works swimmingly. ActiveRecord talks nicely to the MSSQL server using ODBC if I have a User-DSN defined. But if remove the User-DSN and set just an identical System-DSN then odbc bombs:
[Microsoft][ODBC Driver Manager] Data
source name not found and no default
driver specified
I am running Rails on Windows 2003 Server 64bit, using DBI 0.4.1, DBD-ODBC 0.2.4, Rails 2.3.4. I've tried using ODBC manager for 32bit and double-checked that the connection is working from the ODBC Administration panel. Does anyone have any ideas?

Frustrating! As it turns out, I had to use regedit to access HKLM/Software/ODBC/ODBC.INI children key (DSN) and changed the SQLServer driver there to be c:\windows\system32\SQLSRV32.dll. Even though the ODBC Administration Panel had this specified and its tests ran fine, it wasn't working until I tweaked the registry. So odd..
Hope it helps someone else in the future.

For me the problem was that I was entering the ODBC connections into the 64 bit version of the ODBC Data Source Administrator. When I went to
C:\Windows\SysWOW64\odbcad32.exe
, and re-entered the drivers here (the others were not there!), and all worked fine after that.
blog entry where I found this

Related

OLE DB provider for Teradata 15.10.04?

I'm setting up a brand new system and decided to install TTU 15.10.04 (my old machine had TTU 14). When I run my apps, I get this error:
The 'TDOLEDB' provider is not registered on the local machine.
I used to get this error on earlier versions, but all I had to do was make sure my app was running in 32-bit mode. After checking everything multiple times and not being able to isolate the problem, I searched for the OLE DB installation folder on my new machine, but have not been able to find it. So I checked my old machine and found that it was installed here:
C:\Program Files (x86)\Teradata\Client\14.00\OLE DB Provider for Teradata
I have no such equivalent folder on my new machine. The only thing I have is OLE DB Access Module, but I am sure that's not it. I have concluded that I do not have the OLE DB provider installed at all and cannot seem to find out where to get it. It's as if it has disappeared. Any help would be great
You can download the teradata oledb provider for ttu15 HERE
Hope this helps

Pervasive SQL v.11 ODBC Client Interface

I have Pervasive PSQL v.11 server but no PervasiveClient Interface driver on it. I looked for answer and what i found is to install Pervasive Client on server but i am afraid that it may mess the server or configuration. So I am looking for any way to install that driver without installing client application.
When you install the Pervasive Server, it installs the client as well. You should have the Pervasive Client Interface. Make sure you are using the 32 bit ODBC Administrator. It is located in the %systemdrive%\windows\syswow64\odbcad32.exe. The ODBCAD32.EXE in %systemdrive%\Windows\System32 is 64 bit. I know it seems backward but that's how Microsoft did it.
If you are seeing just the "Pervasive ODBC Interface", you are using the 64 bit ODBC Administrator.
Another option would be to use the Pervasive Control Center. It can create the 32 bit DSN when creating the database. It also has menu options (under Tools) for the 32-bit and 64-bit ODBC Administrator.

DBX error in Delphi XE3, when connecting to a SQL Server database

When I try to connect to a MS SQL Server database using DBX an error pops up saying that the driver is not properly installed, or missing. I tried with ADO driver and it worked like charm, but the thing is that I need DBX driver to work because I want to modify an app that has been developed with DBX technology.
I reinstalled Delphi XE3, and also asked a friend of mine to test it and the error is the same. Does somebody has any ideea on how to solve it ?
The exactly message was this:
Borland.Data.TDBXError: DBX Error: Driver could not be properly
initialized. Client library may be missing, not installed properly,
of the wrong version, or the driver may be missing from the system
path.
I must mention that I tried it on a local instance of MSSQL Server 2012 and on a remote MSSQL Server 2008 instance. My OS win8 x64;
Best regards,
This is most likely caused by the wrong version of the SQL Native Client installed on your system. DBX will only work with V10, while you probably have V11 installed. Try to install the V10 version of the client.

Connecting to SQL Server 2005 from a ROR application in Ubuntu

I tried to connect to SQL Server from a ROR application in Ubuntu. For that I did the following things.
I installed the following libraries in my Ubuntu 10.04
unixodbc
unixodbc-dev
freetds-dev
libdbd-odbc-ruby
tdsodbc
After installing these, I created the dsn and made the required changes in odbc.ini and freetds.conf files.
Then I tested the connection using "tsql" like below
tsql -S <dsn name> -U <username> -P <pwd>
For this command, I am getting the following error
Adaptive Server is unavailable
I also checked the freetds log; it is saying "connection timedout".
I am sure that we are fine with the configurations (remote) in our SQL Server side.
When I run tsql -C it is saying TDS Version is 5. I am not sure how it is saying TDS 5, because I installed the latest FreeTDS version. And I don't know how to update my TDS version.
FYI, I heard that TDS version 5 can't be used for making connections with SQL Server. Is that right?
Please guide me
Thanks,
Neo
freetds.conf allows you to specify which version of the TDS protocol you want to use. Just add a tds version = 8.0 under the [global] section or the section you added for your server. If not specified, it defaults to version 5.0, which seems to be your case. For more info, look at http://www.freetds.org/userguide/freetdsconf.htm
I realize this is not an answer to your specific question, but it is some advice from the last time I tried to go from Linux to SQL Server. It was back in 2009, so it's possible something has changed since then.
Anyway, we had so much trouble with it we gave up and decided to use JRuby.
It resulted in very little effort to get the connection up and running using activerecord-jdbc-adapter and we've run into no problems with compatibility. (I take that back, there was one problem I had to fix where we were selecting limited rows in mssql from table with no primary key, identity column, or column named "id")
I have been able to get it working in the past doing it like you're trying to, but it was always a lot more effort than I had to go through with JRuby.

Ruby on Rails + Sql Server 2005

This has been addressed some time ago, but I've not had any luck following the steps outlined or advice suggested. Here's my situation:
I've installed SQL Server '05 and have another (non-Ruby) application utilizing it successfully.
I've got Rails up and running successfully (but only for MySQL.)
I've installed the Rails sqlserver adapter gem (as well as its dependencies.)
I've downloaded ADO.rb (now only available on older builds of Ruby-DBI) and placed it into c:\ruby\lib\ruby\site_ruby\1.8\DBD\ADO\ADO.rb.
I've configured database.yml to use the sqlserver adapter and pointed it towards my database with valid login information.
When I attempt to run a migration, I get the ugly 'Unable to load driver ADO (uninitialized constant DBI::DBD::ADO)' error.
Thanks immensely for any assistance.
So just make sure if you're working on Windows or Mac to set up an ODBC connection. You must indicate this explicitly in your database configuration for Rails.

Resources