Microsoft .Jet.OLEDB.4.0' provider is not registered on the local machine

Discussion in 'C#' started by sbglobal79, Aug 19, 2009.

  1. #1
    I was trying to connect VS 2008 with MS Access 2007

    I am getting the error
    "the 'Microsoft
    .Jet.OLEDB.4.0' provider is not registered on the local machine "

    Mine is Windows XP professional edition.

    I have MS Access 2007, MS Office 2007....I have also downloaded and installed the MS Access Database engine to make sure I have all the dataconnectivity components.

    My code is in C# as :

    // Connection String to Excel Workbook
    string excelConnectionString = @"Provider=Microsoft
    .Jet.OLEDB.4.0;Data Source=c:/test.xls;Extended
    Properties=""Excel 8.0;HDR=YES;""";

    // Create Connection to Excel Workbook
    using (OleDbConnection connection =
    new OleDbConnection(excelConnectionString))
    {
    OleDbCommand command = new OleDbCommand
    ("Select * FROM [test$]", connection);

    connection.Open();

    // Create DbDataReader to Data Worksheet
    using (OleDbDataReader dr = command.ExecuteReader())
    {
    // SQL Server Connection String
    string sqlConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["DBCon"].ToString();

    //string sqlConnectionString = "Data Source=.;
    // Initial Catalog=Test;Integrated Security=True";

    // Bulk Copy to SQL Server
    using (SqlBulkCopy bulkCopy =
    new SqlBulkCopy(sqlConnectionString))
    {
    bulkCopy.DestinationTableName = "tendermaster";
    bulkCopy.WriteToServer(dr);
    }
    }
    }


    but am getting the error The 'Microsoft
    .Jet.OLEDB.4.0' provider is not registered on the local machine."

    somebody please help me to resolve this, i have almost spent 2 complete days going through this---any help will be highly appreciated ....
     
    sbglobal79, Aug 19, 2009 IP
  2. sbglobal79

    sbglobal79 Banned

    Messages:
    724
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Are u getting this problem on local machine or remote machin . Plaese give us link of ur URl where u r getting error .
     
    sbglobal79, Aug 19, 2009 IP
  3. sbglobal79

    sbglobal79 Banned

    Messages:
    724
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #3

    Dear DP User !

    I am getting problem at my local system as well as Remote server .

    You can check this error on this URL :
    http://contractorindia.sbglobal.info/Tenderdata.aspx

    there will be one button in middle bottom . You have to click on it to see error .

    Thanks for quick response.
     
    sbglobal79, Aug 19, 2009 IP
  4. sbglobal79

    sbglobal79 Banned

    Messages:
    724
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #4
    thanks for this
     
    sbglobal79, Sep 23, 2009 IP