Connecting Tech Pros Worldwide Forums | Help | Site Map

c++ and databases

cppaddict
Guest
 
Posts: n/a
#1: Jul 19 '05
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
Guest
 
Posts: n/a
#2: Jul 19 '05

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.

David
Guest
 
Posts: n/a
#3: Jul 19 '05

re: c++ and databases


cppaddict,

On Wed, 22 Oct 2003 01:38:11 UTC, "cppaddict" <cppaddict@yahoo.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
Socketd
Guest
 
Posts: n/a
#4: Jul 19 '05

re: c++ and databases


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

www.wxwindows.org

br
socketd
Deming He
Guest
 
Posts: n/a
#5: Jul 19 '05

re: c++ and databases


cppaddict <cppaddict@yahoo.com> wrote in message
news:7cllb.2990$uW5.1412@newssvr25.news.prodigy.co m...[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.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.


Closed Thread