Neewbie Excel problem

This is a discussion on Neewbie Excel problem within the Windows Programming forums, part of the Platform Specific Boards category; Hi guys.. I'm fairly new in C++ and still trying to grasp some of the basics. I am using a ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    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
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    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
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    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,786
    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,786
    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.
    Attached Files Attached Files

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, 10: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, 05:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21