c++ and databases

Discussion in 'C++' started by cppaddict, Oct 22, 2003.

  1. cppaddict

    cppaddict Guest

    Hi,

    Please let me know if there is a better newsgroup to post this question on,
    but here goes....

    I want to learn the basics of having a C++ program interact with databases
    such as MySQL or SQLServer.

    In particular, I want to write a program which parses a large text file and
    then siphons off the
    various data into appropriate tables and columns in a db.

    1. Can anyone give me any good references to get started (books or web
    articles)?

    2. Can anyone give me an overview of what's involved here, how difficult
    this will
    be to learn, etc? Right now I am a beginner C++ programmer and a fairly
    experienced DB
    designer.

    3. Can anyone explain how such interactions are accomplished, just in very
    general language.
    Does this involve COM objects? How can C++ connect to and issue commands to
    a DB?

    Thanks for any info,
    cpp
    cppaddict, Oct 22, 2003
    #1
    1. Advertising

  2. cppaddict

    Artie Gold Guest

    [OT] Re: c++ and databases

    cppaddict wrote:
    > Hi,
    >
    > Please let me know if there is a better newsgroup to post this question on,
    > but here goes....
    >
    > I want to learn the basics of having a C++ program interact with databases
    > such as MySQL or SQLServer.
    >
    > In particular, I want to write a program which parses a large text file and
    > then siphons off the
    > various data into appropriate tables and columns in a db.
    >
    > 1. Can anyone give me any good references to get started (books or web
    > articles)?
    >
    > 2. Can anyone give me an overview of what's involved here, how difficult
    > this will
    > be to learn, etc? Right now I am a beginner C++ programmer and a fairly
    > experienced DB
    > designer.
    >
    > 3. Can anyone explain how such interactions are accomplished, just in very
    > general language.
    > Does this involve COM objects? How can C++ connect to and issue commands to
    > a DB?
    >


    You're in the wrong place -- C++ itself knows not of databases.

    STFW!

    [try: http://www.mysql.com/products/mysql /index.html]

    HTH,
    --ag




    --
    Artie Gold -- Austin, Texas
    Oh, for the good old days of regular old SPAM.
    Artie Gold, Oct 22, 2003
    #2
    1. Advertising

  3. cppaddict

    David Guest

    cppaddict,

    On Wed, 22 Oct 2003 01:38:11 UTC, "cppaddict" <> wrote:

    > Hi,
    >
    > Please let me know if there is a better newsgroup to post this question on,
    > but here goes....
    >
    > I want to learn the basics of having a C++ program interact with databases
    > such as MySQL or SQLServer.
    >
    > In particular, I want to write a program which parses a large text file and
    > then siphons off the
    > various data into appropriate tables and columns in a db.
    >
    > 1. Can anyone give me any good references to get started (books or web
    > articles)?


    Look at the examples for a given database, such as MySQL. There are
    examples and the engine is pretty easy to get installed. It will teach
    you the basics. MS Access and MS SQL are progressively more industrial
    strength but follow the same basic guidelines. If you use one of the
    MS interfaces, such as ODBC, porting your code from one database to another
    is very simple.

    There are also several databases with full source. Some are like MySQL.

    > 2. Can anyone give me an overview of what's involved here, how difficult
    > this will
    > be to learn, etc? Right now I am a beginner C++ programmer and a fairly
    > experienced DB
    > designer.


    Given the examples from MySQL, you could probably adapt them to your
    own needs pretty quickly. MS SQL offers many more interface types: DAO,
    ADO, ODBC, XML, ...

    > 3. Can anyone explain how such interactions are accomplished, just in very
    > general language.
    > Does this involve COM objects? How can C++ connect to and issue commands to
    > a DB?


    Any form of IPC (Inter process communication) is useful. Many engines are

    just TCP/IP servers. Any small example should get you started.

    > Thanks for any info,
    > cpp


    David
    David, Oct 22, 2003
    #3
  4. cppaddict

    Socketd Guest

    On Wed, 22 Oct 2003 01:38:11 GMT
    "cppaddict" <> wrote:

    > I want to learn the basics of having a C++ program interact with
    > databases such as MySQL or SQLServer.


    www.wxwindows.org

    br
    socketd
    Socketd, Oct 22, 2003
    #4
  5. cppaddict

    Deming He Guest

    cppaddict <> wrote in message
    news:7cllb.2990$...
    > Hi,
    >
    > Please let me know if there is a better newsgroup to post this question

    on,
    > but here goes....
    >
    > I want to learn the basics of having a C++ program interact with databases
    > such as MySQL or SQLServer.
    >
    > In particular, I want to write a program which parses a large text file

    and
    > then siphons off the
    > various data into appropriate tables and columns in a db.
    >
    > 1. Can anyone give me any good references to get started (books or web
    > articles)?
    >
    > 2. Can anyone give me an overview of what's involved here, how difficult
    > this will
    > be to learn, etc? Right now I am a beginner C++ programmer and a fairly
    > experienced DB
    > designer.
    >
    > 3. Can anyone explain how such interactions are accomplished, just in

    very
    > general language.
    > Does this involve COM objects? How can C++ connect to and issue commands

    to
    > a DB?
    >
    > Thanks for any info,
    > cpp
    >
    >

    For SQL server, better use ADO. Go to: microsoft.public.data.ado for more
    info.

    To issue command, you need to use an ADO connection object of pointer type,
    _CommandPtr. MSDN has included tons of info about this.
    Deming He, Oct 31, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William Ryan
    Replies:
    0
    Views:
    426
    William Ryan
    Oct 3, 2003
  2. Cowboy \(Gregory A. Beamer\)
    Replies:
    1
    Views:
    1,240
    Guinness Mann
    Oct 6, 2003
  3. Aaron
    Replies:
    6
    Views:
    1,213
    Aaron
    Sep 6, 2004
  4. Ken North
    Replies:
    0
    Views:
    588
    Ken North
    Jul 14, 2005
  5. Sebastian Bassi
    Replies:
    5
    Views:
    412
    John Bokma
    May 29, 2010
Loading...

Share This Page