C++ ODBC how to query Excel documents through which sheet as well as its name?

I'm doing database import and export, the query to export to Excel file has been achieved. Each table in an sheet table to export to excel file, does not need to establish the file. Then now is to reverse the operation, will contain more than one form of the data in the excel file name will be sheet as a database table name, into the database. The question now is: the name of the excel file in the sheet effective number and sheet are uncertain, do not know how to access through the ODBC to get the sheet number and name of the excel file, therefore cannot then downward implementation. Check a lot of information, the Internet is basically the same article reproduced crazy, not a word was changed!!! Collapse, results in foreign website check, the article is original. There is no other article. The article mentioned only one sheet, and sheet are set in advance good. For me this function, completely useless. Do not know if there is no God guide, please enlighten me!!! Thanks in advance!!

Started by Tom at November 11, 2016 - 9:57 PM

       public List<string> GetSheetNames()
        {
            List<string> list = new List<string>();
            Excel.Sheets sheets = wbclass.Worksheets;
            string sheetNams = string.Empty;
            foreach (Excel.Worksheet sheet in sheets)
            {
                list.Add(sheet.Name);
            }
            return list;
        }

Posted by Melinda at November 15, 2016 - 10:34 PM

This is based on COM component and excel component implementation, implementation method and not ODBC. I want to have that name to query all sheet database query, can not know this, or any other method based on ODBC.

Posted by Tom at November 25, 2016 - 10:42 PM

Have done similar things, the answer is no, don't remember is it right? With 2 floor, when using the method is BUG, if the excel file manually modify cannot obtain the correct Sheet name, and only agreed customer specific name

Posted by Helen at November 27, 2016 - 11:25 PM

Thanks. Oh, really is very difficult.

Posted by Tom at November 30, 2016 - 11:33 PM

I was also looking for dying, customers have to say can make, implement, I depressed for a long time do not come out, then ask the customer to code, and online as like as two peas, as well as the designated name, did not change TestSheet, I was angry at that time

Posted by Helen at December 10, 2016 - 11:56 PM

Only know that ADO method

Posted by Brenda at December 12, 2016 - 12:30 AM