I have a very simple app that reads from backoffice accounting systems and transfers text files to my server. My problem is with a System based on an Interbase DB. Everything has gone fine except for 4 of my 120 customers. When pulling a 'ClientRemarks' field my ODBCDataReader competely crashes the app. In most cases, I don't even get an catch exception message. I have seen on occassion a message saying, "Attempted to read or write protected memory".

Here is my stripped down code:
Code:
using System;
using System.Text.RegularExpressions;
using System.Data.Odbc;

namespace ConsoleAppForTesting
{
    class Program
    {
        static void Main(string[] args)
        {

            promptContinue();
            getData();
            promptContinue();

        }
        
        static void getData()
        {
            OdbcDataReader AgencyODBCdr;
            
            string ODBCConnString = "DSN=TRAMS ODBC Datasource;";
                  ODBCConnString += "UID=*******;";
                  ODBCConnString += "PWD=*******;";
            
            string SelectSales = @"
                SELECT B.BOOKINGNO,I.INVOICENUMBER,B.CLIENTREMARKS
                FROM INVOICE I INNER JOIN BOOKING B ON I.INVOICENO=B.INVOICE_LINKNO
                WHERE (I.ISSUEDATE>='2/23/11' AND I.ISSUEDATE <= '2/23/11')
                    AND I.INVOICENUMBER < 4000
                ORDER BY I.INVOICENUMBER
            ";

            try
            {
                OdbcConnection AgencyODBCConn = new OdbcConnection(ODBCConnString);
                AgencyODBCConn.ConnectionTimeout = 60;

                OdbcCommand SaleODBCComm = new OdbcCommand(SelectSales, AgencyODBCConn);
                SaleODBCComm.CommandTimeout = 1180;
                
                AgencyODBCConn.Open();
                AgencyODBCdr = SaleODBCComm.ExecuteReader(System.Data.CommandBehavior.SequentialAccess);

                try
                {
                    if (AgencyODBCdr.HasRows)
                    {
                        Console.Clear();
                        while (AgencyODBCdr.Read())
                        {
                            Console.WriteLine(AgencyODBCdr.GetValue(0).ToString());
                            Console.WriteLine(AgencyODBCdr.GetValue(1).ToString());

                            string mine = "";
                            Console.WriteLine(AgencyODBCdr.GetDataTypeName(2));
                            Console.WriteLine(AgencyODBCdr.GetFieldType(2));
                            Console.WriteLine(AgencyODBCdr.GetName(2));
                            if (!AgencyODBCdr.IsDBNull(2))
                            {
                                try
                                {
                                    Console.WriteLine(AgencyODBCdr.GetValue(2));
                                }
                                catch (Exception err002)
                                {
                                    Console.WriteLine("Error: " + err002.Message);
                                }
                            }
                            Console.WriteLine();
                        }
                    }
                    AgencyODBCdr.Close();
                    AgencyODBCConn.Close();
                }
                catch (Exception err000)
                {
                    
                    Console.WriteLine(Environment.NewLine + Environment.NewLine +"Sales Error");
                    Console.WriteLine("Unable to Create Sales Data File... Please Try Again." + Environment.NewLine + Environment.NewLine +
                        "Data: "       + err000.Data       + Environment.NewLine + Environment.NewLine +
                        "Message: "    + err000.Message    + Environment.NewLine + Environment.NewLine +
                        "Source: "     + err000.Source     + Environment.NewLine + Environment.NewLine +
                        "StackTrace: " + err000.StackTrace + Environment.NewLine + Environment.NewLine +
                        "TargetSite: " + err000.TargetSite + Environment.NewLine + Environment.NewLine);
                }
            }
            catch (Exception err001)
            {
                Console.WriteLine("ODBC Error");
                Console.WriteLine("Unable to Extract from " + ODBCConnString + " Database... Please Check Your Settings and Try Again." + Environment.NewLine + "Error Details: " + Environment.NewLine + err001.Message);  
            }
        }

        static void promptContinue()
        {
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("===============================================================================");
            Console.WriteLine("Press any key to continue.");

            ConsoleKeyInfo mine2 = Console.ReadKey(true);
            Console.Clear();
            Console.WriteLine("Please wait...");
        }
    }
}
The moment I try to access the ClientRemark (AgencyODBCdr.GetValue(2) is where I blow up. The client remark field is type varchar(1024).

The output from the caode typically will look like this:

96082
10003388
VARCHAR
System.String
CLIENTREMARKS



96126
10003389
VARCHAR
System.String
CLIENTREMARKS
Disney Magical Express Room Only Pick-up location: Orlando, FL (MCO)




98196
11000960
VARCHAR
System.String
CLIENTREMARKS
.....

Does anyone have an idea of what is happening and how to get around this DR problem?