Forum: Ruby on Rails sqlserver image columns

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jebus (Guest)
on 2006-02-06 17:51
(Received via mailing list)
I am trying to upload word docs to an image column. I followed the
cookbook for how to upload files and it works on a MySQL db (upload
and download) on SQLServer however I get the following error
DBI::DatabaseError: Execute
    OLE error code:80040E07 in Microsoft OLE DB Provider for SQL Server
      Operand type clash: text is incompatible with image
    HRESULT error code:0x80020009

Also I when I try to retrieve one (I put one in with java), all I get
is numbers. It doesn't look it is being converted to binary.

Here is some my code
class Attachment < ActiveRecord::Base
def initialize (tmpfile)
	self.filename = tmpfile.original_filename
	self.content_type = tmpfile.content_type
	self.created ="%Y%m%d %I:%M")
	self.file =

Here is how I am rendering the documents
send_data attachment.file, :filename => attachment.filename, :type =>
This topic is locked and can not be replied to.