Here is my code:
private const string CONNECTION_STRING
= "Driver={Microsoft dBase Driver (*.dbf)};"
+ "collatingsequence=ASCII;"
+ "defaultdir={0};"
+ "driverid=277;"
+ "maxbuffersize={1};"
+ "pagetimeout={2}";
string connString = string.Format(CONNECTION_STRING, filePath, MAX_BUFFER_SIZE, PAGE_TIMEOUT);
using (var _conn = new System.Data.Odbc.OdbcConnection(connString))
{
_conn.Open();
using (var _comm = _conn.CreateCommand())
{
_comm.CommandText = QUERY_STRING;
_comm.CommandType = CommandType.Text;
using (var rdr = _comm.ExecuteReader())
{
while (rdr.Read())
{
/*Do something*/
}
}
}
}
The error message I am getting is SQL Execution Error. Executed SQL statement: SELECT * FROM MyTable Error Source odbcjt32.dll Error Message Error [HY001][Microsoft][ODBC dBase Driver] System resource exceeded.
Several Gigs of RAM and HD open, before and after the query. And this always works on the first pass, but fails on all consecutive passes.
Running in Win 7 64, and .NET 4.0.
When I get the error, I end up rebooting to clear it. Though I haven't tried just doing a GC flush yet.