title: What does "Attribute" mean in the ACE text file driver data type "LongChar Attribute 32"?
body: <p>For example, I'm looking at the following schema.ini:</p>
  
  <pre><code>[test.csv]
  ColNameHeader=True
  CharacterSet=1252
  Format=CSVDelimited
  Col1=JET1 Bit
  Col2=JET2 Byte
  Col3=JET3 Short
  Col4=JET4 Integer
  Col5=JET5 Currency
  Col6=JET6 Single
  Col7=JET7 Float
  Col8=JET8 Date
  Col9=JET9 LongChar Attribute 32
  Col10=JET10 LongChar Attribute 32
  Col11=ODBC1 Char Width 255
  Col12=ODBC2 Float
  Col13=ODBC3 Integer
  Col14=ODBC4 LongChar Attribute 32
  Col15=ODBC5 Date
  </code></pre>
  
  <p>generated by the following C#:</p>
  
  <pre><code>using System;
  using System.Data.OleDb;
  
  namespace Sandbox1
  {
      class Program
      {
          const string ConnStr =
  @"
  Provider=Microsoft.ACE.OLEDB.12.0;
  Extended Properties=""Text;DATABASE=C:\Test""
  ";
  
          static void Main(string[] args)
          {
              using (var conn = new OleDbConnection(ConnStr))
              using (var cmd = conn.CreateCommand())
              {
                  conn.Open();
                  cmd.CommandText =
  @"
  CREATE TABLE [test.csv]
    (
      JET1 BIT,
      JET2 BYTE,
      JET3 SHORT,
      JET4 LONG,
      JET5 CURRENCY,
      JET6 SINGLE,
      JET7 DOUBLE,
      JET8 DATETIME,
      JET9 TEXT,
      JET10 MEMO,
      ODBC1 CHAR,
      ODBC2 FLOAT,
      ODBC3 INTEGER,
      ODBC4 LONGCHAR,
      ODBC5 DATE
    )
  ";
                  cmd.ExecuteNonQuery();
              }
  
              //TestPossibleLimit(); // see below (in this SO Q)
          }
      }
  }
  </code></pre>
  
  <p>which I wrote to explore what's described at the following MSDN page:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/ms709353%28v=vs.85%29.aspx" rel="nofollow">Schema.ini File (Text File Driver)</a></p>
  
  <p>The closest-seeming explanation I could find in the "Text File Driver Programming Considerations" docs is here:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/ms715429%28v=vs.85%29.aspx" rel="nofollow">Text File Data Types</a></p>
  
  <blockquote>
    <p>LONGCHAR : The theoretical limit on the width of a LONGCHAR column in
    either a fixed-length or delimited table is 65500K. The Text ISAM is
    more likely to provide reliable support up to about 32K.</p>
  </blockquote>
  
  <p>My thinking had been that the "Attribute 32" might indicate the number of kilobytes of text that's supported by the text file driver for the LONGCHAR data type, but I couldn't find any further information to confirm this.</p>
  
  <p>So I threw in the following method to test that idea by inserting strings just shorter and just longer than this limit:</p>
  
  <pre><code>static void TestPossibleLimit()
  {
      using (var conn = new OleDbConnection(ConnStr))
      using (var cmd = conn.CreateCommand())
      {
          conn.Open();
  
          var possibleLimit = 32 * 1024;
          for (var len = possibleLimit - 10;
               len &lt;= possibleLimit + 10;
               ++len)
          {
              Console.Write("Inserting string of {0} 'x' characters...", len);
  
              cmd.CommandText = string.Format(
                  "INSERT INTO [test.csv] (ODBC4) VALUES ('{0}')",
                  new string('x', len));
              cmd.ExecuteNonQuery();
  
              Console.WriteLine(" Done!");
          }
  
          Console.WriteLine("All done!");
      }
  }
  </code></pre>
  
  <p>The bad (or good?) news is that it worked fine---all output shown, no exceptions thrown, and the CSV reflects the insertions.</p>
  
  <p>And so, since this Q's title has probably already scrolled out of your view:</p>
  
  <p><strong>What does "Attribute" mean in the ACE text file driver data type "LongChar Attribute 32"?</strong></p>
  
  <p>Note: Since I'm not entirely clear on the differences between ACE and Jet, I also tried the above code with the Jet 4 provider and got the same schema.ini and insertion behavior.</p>