I am developing using C#, and want to open mdb files and query their tables.
But I don't want to use any additional installations (MS Access Software or MS Access Engine). Is there any way to do that.
However, It is very necessary to run the application on AnyCPU with one version of it. Not one for 32bit neither one for 64bit.
Any Help Please?
With my respect.
Edit -
Someone said this question is answered with this old one but not!
The answer is what @GordThompson said in the comments - Thanks again for him.
In details, it is:
var connectionString = @"Driver={Microsoft Access Driver (*.mdb)};Dbq=" + path + ";";
using (var connection = new OdbcConnection(connectionString))
{
connection.Open();
DataTable Main = new DataTable();
var cmd = new OdbcCommand("SELECT * FROM Main", connection);
var adapter = new OdbcDataAdapter(cmd);
adapter.Fill(Main);
}