Strange SQL Server error


#1

Hi,
In an app I’m developing I’ve run into a strange problem. I’ve created
some controllers and models using the scaffolding generator and
everything seemed to work fine.
However I’ve noticed that a particular model I’ve created always fails
its tests and I can’t test it out in a browser due to the same error I’m
getting which is:

ActiveRecord::StatementInvalid (DBI::DatabaseError: S1090 (0)
[iODBC][Driver Manager]Invalid string or buffer length: SELECT * FROM
(SELECT TOP 10 * FROM (SELECT TOP 10 * FROM info_lists ) AS tmp1 ) AS
tmp2)

I’m connecting to a MS SQL Server 2000 via Freetds on a mac, which is
probably something to do with my problem. It doesn’t matter if there’s
data in the test database or not as it still fails.

Any help greatly appreciated

Jon


#2

Sorry I was meant to say that I am using the Openlink ODBC drivers, not
Freetds for Mac.

Jon


#3

You might try the Actual driver and see if it works wit that one. If
so, then you’ll at least know it has something with the driver. The
free use version of the Actual driver is severely limited, but at
least you can find out if it works.

Jamie


#4

Yeah, you’re right it was the driver. In the end I went with Freetds
instead and it solved the problem.

Cheers

Jon