C# .NET - Connecting C# with Access 95 database

Asked By rohit on 06-Apr-13 01:55 AM
Hi, 


in my current project, i have to read data from Access 95 database and insert into MySQL database,


Using following Syntex but i am not able to read data from Access 95 database, same code is working with Access 97 or above databases but its not working with this file.


public DataTable getData()
        {
                       OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Test1.mdb;Uid=Admin;Pwd=testPassword;");
            DataTable dt = new DataTable();
            try
            {
                string sql = "select * from docket";
                
                OleDbDataAdapter da = new OleDbDataAdapter(sql, cn);


                da.Fill(dt);
                dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                messagebox.Show(err.Message);
            }
            finally
            {
                cn.Close();
            }
            return dt;
        }




Please help me to solve this issue.


Thanks in Advance...


Rohit Gupta
Danasegarane Arunachalam replied to rohit on 06-Apr-13 05:39 AM
Are you getting any errors?
rohit replied to Danasegarane Arunachalam on 06-Apr-13 06:11 AM
Yes,

I am getting error "

http://www.codeproject.com/Questions/573347/CouldplusnotplusfindplusinstallableplusISAM

"

Thanks Rohit Gupta
Danasegarane Arunachalam replied to rohit on 06-Apr-13 06:32 PM
This looks like the OLEDB engine 4.0 version is not supported by the Access 95. Try accessing .mdb driver. Change your connection string as (http://connectionstrings.com/access)

Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;


And try