Hi,
I have been looking for several hours for code that automatically checks if Microsoft acess database engine is installed. If not it reinstalls the database driver by first detecting architechture(32/64 bit). It then automatically installs the driver. I am using Ms Access database 2007 as data source for my app but this just came up after I realized that it won't run on a computer without a Access installed.
I figured out the code to detect if the engine is not installed but am not sure if its foolproof. Here is what I thought would be good detecting if engine is installed
try
{
using (OleDbConnection conn = new OleDbConnection(databaseConnString.GetConnectionString))
{
conn.Open();
}
}
catch(InvalidOperationException ioex)
{
//Here is where I want to install the Database engine //since this exception means engine isn't installed
}
Please help provide me with code to detect architecture (32/64 bit ) then install the relevant engine. I have downloaded db engines for both 32 and 64 bit.
Thanks in advance.