#1
  1. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12

    Excel based ifstream?


    is it possible to read in data from an excel database using C++? And if so, is it possible to specify read direction (i. e. which numbers it reads in first-last) Thanks.
    Last edited by AGibel; June 10th, 2003 at 11:54 AM.
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,162
    Rep Power
    2222
    That's what OLE is for. Excel will function as an OLE server and your program as an OLE client.

    I haven't played with it myself, but at least now you know what TLA ("three-letter acronym") to research.
  4. #3
  5. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12
    ::shudder::

    I was hoping that wouldn't be the solution. I had looked into OLE before and was rather baffled. Well, guess I'll give it another try. Thanks.
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,162
    Rep Power
    2222
    OK, let's back up a wee bit.

    Using OLE would require that Excel be running (I think that it automatically starts Excel). But are you instead asking about reading an Excel file itself for the data? That should not require OLE, but instead it would require you to be very familiar with the format of an Excel file. I would think that OLE would be a lot simpler.

    Excel can save data to various formats, including comma-separated-values (CSV). Could that be a possible route?
  8. #5
  9. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12
    CSV huh? Yes that would probably work out well for the reading part. Thanks.

IMN logo majestic logo threadwatch logo seochat tools logo