Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Unknown SQL Type - 0.
Wed, Jan 25 2012 3:19 PMPermanent Link

Mike Corrente

I'm not sure whether to be proud or embarrassed that 4 of the last 6 posts in this forum are mine.  I like to solve my problems publicly so others can benefit from (or laugh at) my mistakes.

Anyway, when trying to use an ODBCDataReader to read the contents of a BLOB field, I get error "Unknown SQL Type - 0."  Pretty simple code - just a SELECT * FROM Table query with one BLOB field at the end.  Rest of the fields read just fine.

Am I missing something.  Can BLOB fields not be read using DataReader?
Wed, Jan 25 2012 10:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< I'm not sure whether to be proud or embarrassed that 4 of the last 6
posts in this forum are mine.  I like to solve my problems publicly so
others can benefit from (or laugh at) my mistakes. >>

No problem at all. Smile

<< Anyway, when trying to use an ODBCDataReader to read the contents of a
BLOB field, I get error "Unknown SQL Type - 0."  Pretty simple code - just a
SELECT * FROM Table query with one BLOB field at the end.  Rest of the
fields read just fine. >>

I just tried the following in C#/VS2008:

       private void button1_Click(object sender, EventArgs e)
       {
           OdbcConnection DataConnection = new OdbcConnection("DSN=Temp");
           OdbcCommand DataCommand = new OdbcCommand();
           DataCommand.Connection = DataConnection;

           DataConnection.Open();

           DataCommand.CommandText = "SELECT * FROM Albums";
           DataCommand.Prepare();

           OdbcDataReader DataReader = DataCommand.ExecuteReader();
           DataReader.Read();
           DataReader.GetValue(8);
           MessageBox.Show(DataReader.GetString(9));
           DataReader.Read();
           DataReader.GetValue(8);
           MessageBox.Show(DataReader.GetString(9));

           DataCommand.Dispose();
           DataConnection.Close();
       }
and it works fine.  The Albums table has both a Blob field (8) and a Clob
(9) field.

If you could email me your code/table, I can take a further look and see
what the issue is.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Jan 26 2012 9:16 AMPermanent Link

Mike Corrente

Thanks, Tim.  Sent my code and table to you.  When you fix me, I'll come back and post solution.
Fri, Jan 27 2012 8:55 AMPermanent Link

Mike Corrente

Tim,

Not sure if this matters, but forgot to mention the table is v3.
Tue, Feb 7 2012 11:33 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< Not sure if this matters, but forgot to mention the table is v3. >>

Handled via email.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 11 2016 2:44 PMPermanent Link

Suler Abou

Secure Check Cashing, Inc.

I have the same issue, can you let me know how you solved this?

"Tim Young [Elevate Software]" wrote:

Mike,

<< Not sure if this matters, but forgot to mention the table is v3. >>

Handled via email.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image