ADO: Excel: Is it possible to open recordset on table name?
问题 I have looked on the web but did not find any answer. So i am putting it here. Code snippet: ( where case 1 is not working.. ) _bstr_t strCnn(L"Provider='Microsoft.ACE.OLEDB.12.0';DataSource=C:\\Book.xlsx;Extended Properties=\"Excel 12.0 Xml; HDR = YES\""); hr = pConn->Open(strCnn, "", "", adConnectUnspecified); // success **LPCSTR strQuery = "select * FROM Table1"; // case1: Not working** LPCSTR strQuery = "select * FROM [Sheet1$]"; // case2: working LPCSTR strQuery = "select * FROM [Sheet1