开发者

Read Excel sheet using ADO on Visual C++

We have an old application written using VC++ that uses ODBC driver to read the excel data.

There are problems in current code with mixed data type and li开发者_C百科mitations of ODBC driver.

SO I am planning to use Jet OLE DB driver and use ADO

The code I have opens ADO connection and reads excel sheet.No issues here..

The biggest problem is everytime, Open() is called, it brings up the Excel sheet and displays to the user (if it is not already open). I tried to look into the parameters, but did not find any suggestions to hide main excel window.

Any suggestions?

The connection string I am using is

Provider='Microsoft.JET.OLEDB.4.0';Data Source=temp.xls;Extended Properties="Excel 8.0;IMEX=1;HDR=NO"


Three options spring to mind:

  1. Use Automation to open the spreadsheet in a hidden window. I.e. you can create an instance of the Excel application, hide the main window, and open the spreadsheet in that window.
  2. Use the ISAM driver instead of the JET driver. That may change the behaviour in undesirable ways though.
  3. Live with it.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜