none
Importing data from excel using ado in vc++ RRS feed

  • Question

  • Hello,

    I am trying to read data from excel sheet without saving it in a csv file using vc++ (visual studio 2008). Can you please suggest some helpful links or a starting point for this.

    thanks much!
    Friday, April 17, 2009 2:23 PM

Answers

  • Hi,

    You can read Excel files in ADO.NET by using OleDb or ODBC. Have a look at the following for some more information:

    How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET:
    http://support.microsoft.com/kb/316934

    HOW TO: Use Jet OLE DB Provider 4.0 to Connect to ISAM Databases:
    http://support.microsoft.com/default.aspx/kb/326548

    Excel Connection String Samples (have a look in the sections ".NET Framework Data Provider for OLE DB" and ".NET Framework Data Provider for ODBC"
    http://www.connectionstrings.com/excel

    Hope this helps,
    Jared
    Postings are provided "As Is" with no warranties and confer no rights.
    Friday, April 17, 2009 6:36 PM
  • One addition to Jared's post. If you are going to read data from Excel files stored in 2007 formats (xlsx or xlsb), you would need to use ACE OLEDB provider instead of Jet OLEDB provider
    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, April 21, 2009 9:58 AM
    Moderator

All replies

  • Hi,

    You can read Excel files in ADO.NET by using OleDb or ODBC. Have a look at the following for some more information:

    How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET:
    http://support.microsoft.com/kb/316934

    HOW TO: Use Jet OLE DB Provider 4.0 to Connect to ISAM Databases:
    http://support.microsoft.com/default.aspx/kb/326548

    Excel Connection String Samples (have a look in the sections ".NET Framework Data Provider for OLE DB" and ".NET Framework Data Provider for ODBC"
    http://www.connectionstrings.com/excel

    Hope this helps,
    Jared
    Postings are provided "As Is" with no warranties and confer no rights.
    Friday, April 17, 2009 6:36 PM
  • One addition to Jared's post. If you are going to read data from Excel files stored in 2007 formats (xlsx or xlsb), you would need to use ACE OLEDB provider instead of Jet OLEDB provider
    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, April 21, 2009 9:58 AM
    Moderator