c++ and databases

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cppaddict

    c++ and databases

    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


  • Artie Gold

    #2
    [OT] Re: c++ and databases

    cppaddict wrote:[color=blue]
    > 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?
    >[/color]

    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.

    Comment

    • David

      #3
      Re: c++ and databases

      cppaddict,

      On Wed, 22 Oct 2003 01:38:11 UTC, "cppaddict" <cppaddict@yaho o.com> wrote:
      [color=blue]
      > 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)?[/color]

      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.
      [color=blue]
      > 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.[/color]

      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, ...
      [color=blue]
      > 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?[/color]

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

      just TCP/IP servers. Any small example should get you started.
      [color=blue]
      > Thanks for any info,
      > cpp[/color]

      David

      Comment

      • Socketd

        #4
        Re: c++ and databases

        On Wed, 22 Oct 2003 01:38:11 GMT
        "cppaddict" <cppaddict@yaho o.com> wrote:
        [color=blue]
        > I want to learn the basics of having a C++ program interact with
        > databases such as MySQL or SQLServer.[/color]



        br
        socketd

        Comment

        • Deming He

          #5
          Re: c++ and databases

          cppaddict <cppaddict@yaho o.com> wrote in message
          news:7cllb.2990 $uW5.1412@newss vr25.news.prodi gy.com...[color=blue]
          > Hi,
          >
          > Please let me know if there is a better newsgroup to post this question[/color]
          on,[color=blue]
          > 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[/color]
          and[color=blue]
          > 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[/color]
          very[color=blue]
          > general language.
          > Does this involve COM objects? How can C++ connect to and issue commands[/color]
          to[color=blue]
          > a DB?
          >
          > Thanks for any info,
          > cpp
          >
          >[/color]
          For SQL server, better use ADO. Go to: microsoft.publi c.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.


          Comment

          Working...