Thread: Neewbie Excel problem

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    2

    Smile Neewbie Excel problem

    Hi guys..
    I'm fairly new in C++ and still trying to grasp some of the basics.

    I am using a C++ Builder and my question is...how do I connect to Excel worksheet using C++, ADO or ODBC?how do I do this?

    Any pointers would be greatly appreciated..
    Thnks guys.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I'm pretty sure a board search for "excel" will turn something up
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    To connect to a worksheet or use ADO you need COM programming experience.

    For ODBC, you need experience with the ODBC API and probably a bit a bit of WinAPI.

    All of this is fairly intermediate stuff. I'd keep up the work on the basics first if I were you.

  4. #4
    Registered User
    Join Date
    Jul 2004
    Posts
    60
    You can use ios::bin or ios::binary in fstream but you would have to know the format of excel
    Child who knows C++
    Using Borland C/C++ Compiler 5.5 (Command Line Version)

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Actually that's not a good idea. For future reference, you can get file formats at wotsit.org.

    If Kawia has not yet mastered the basics, let alone how to use APIs, there's really no point in learning binary file i/o. By the time he gets to that point he probably will have the skill to learn the aforementioned APIs anyway.

    My advice to kawia is to just keep learning C++, read a couple of books, etc... and when you're comfortable with most of the features of C++, take a look at some of these APIs.

  6. #6
    Registered User
    Join Date
    Jul 2004
    Posts
    60
    I don't have the skill to learn APIs and I know binary file i/o. I think it's simple, but; whatever!
    Child who knows C++
    Using Borland C/C++ Compiler 5.5 (Command Line Version)

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Well there really is no difference between learning an API and learning iostreams. One's standard (or was) and one's not. That's it. Doing binary file i/o on a commercial file is a ridiculous idea when there's a fairly high-level API right in front of you.

  8. #8
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    From the question;

    >>connect to Excel worksheet

    I think he's talking about using excel properly (via COM automation - not the lame old trick of creating a CSV file

  9. #9
    Registered User
    Join Date
    Aug 2004
    Posts
    2
    I want to connect to excel worksheet/sheets using ADO and read a file, not converting the file to text .
    Thanks.

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Quote Originally Posted by kawia
    I want to connect to excel worksheet/sheets using ADO and read a file, not converting the file to text .
    Thanks.
    Honestly, if your a newb it's a bit too much of a job.

    Just to satisfy your curiosity, heres a working example in VC++ of how to use ADO to read from an excel sheet.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM