Releasing dBase (OleDB) resources
I've digged Inted and found no answer for problem I found.
When I connect the dBase files, the directory where dbf files are stored cannot be removed anymore untill the process (application) is closed completly. Closing datareader, connection etc doesn't help.
a bit of code:
conn_batch = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + data_dir + ";Extended Properties=DBASE IV;"); // here the data_dir directory can be still deleted cmd = new System.Data.OleDb.OleDbCommand(); while (dr_batch.Read()) cmd = null; // directory data_dir cannot be deleted!!!OleDbConnection conn_batch = null;
OleDbCommand cmd = null;
OleDbDataReader dr_batch = null;
conn_batch.Open();
cmd.Connection = conn_batch;
cmd.CommandText = "SELECT * FROM BATCH"
dr_batch = cmd.ExecuteReader();
{
// reading fields
}
dr_batch.Close();
dr_batch = null;
conn_batch.Close();
conn_batch = null;
The simmilar code with Access database works ok. Looks like bug for dBase or I missed something?
Best regards
Michal K.

