[Mono-list] Still problems with database access using ODBC

A Rafael D Teixeira rafael.teixeirabr at terra.com.br
Mon Jul 11 12:36:54 EDT 2005


ODBC isn't the best way to connect databases with ADO.NET, period.

Although Suresh has been committing some patches recently on the
System.Data.Odbc namespace, I don't think it is thoroughly tested with
multiple database server types, as it is simply not feasible.

Unfortunately the only ADO.NET provider for Informix I've found  is a
commercial one from the fine people at OpenLink:

IBM itself doesn't like .NET very much so they only tell how to use ODBC
to connect from ADO.NET to an Informix server. As they favor Java their
JDBC driver is in better shape as it is a pure-Java (Type 4) driver. So
it may be possible to use it through IKVM on Mono, but it is not in any
way easily integratable with ADO.NET's DataTables/DataSets.


On Mon, 2005-07-11 at 13:28 +0200, lunkwill at gmx.net wrote:
> Hi Suresh!
> thanx for the quick help. But I'm afraid it won't help. 
> I now compiled the Mono snapshot from 2005-07-08 from scratch and tested
> again.
> As a result I get no exceptions but also no results when accessing firebird 
> SQL. When using Informix (my production db) I now get the following
> exception:
> Unhandled Exception: System.Data.Odbc.OdbcException:
> [unixODBC][Informix][Informix ODBC Driver]String data right truncation.
> in <0x00131> System.Data.Odbc.OdbcCommand:ExecSQL (System.String sql)
> in <0x00073> System.Data.Odbc.OdbcCommand:ExecuteNonQuery (Boolean
> freeHandle)
> in <0x00011> System.Data.Odbc.OdbcCommand:ExecuteReader (CommandBehavior
> behavior)
> in <0x0000c> System.Data.Odbc.OdbcCommand:ExecuteReader ()
> in (wrapper remoting-invoke-with-check)
> System.Data.Odbc.OdbcCommand:ExecuteReader ()
> in <0x002a6> MainClass:Main (System.String[] args)
> Meanwhile I crosschecked with Python/ODBC from my SLES9 to ensure that the
> Informix ODBC driver is capable of SqlParameter at all.
> Still nobody else with problems like this?
> Best regards,
> /daniel
> > > Hi all!
> > > 
> > > Nearly 2 months ago I posted a bug (
> > > http://bugzilla.ximian.com/show_bug.cgi?id=74917 ) about using SQL
> > > parameters in ODBC queries.
> > > In short: using OdbcParameter with int-parameters works; with char and
> > > varchar-parameters it fails
> > 
> > i've just did a work-around fix. hope that helps you. I've been using 
> > WCHAR & WVARCHAR and it seems it is not fully supported from odbc 
> > provider. It is working with sqlserver odbc tds driver, which I tested
> > now.
> > 
> > suresh.
> > 

More information about the Mono-list mailing list