C++ with SQL

S

Some Clown

Greetings - I'm sure there's another place to ask this, but I'm not sure
what it is... so I'll be brief. I'd like to be pointed to somewhere (web,
book, whatever) where I can learn how to access a database from C++ using
SQL (I'm assuming this would be best) such as the tables and queries in an
existing Access database. I'd like to do this all via command-line without
having to use a GUI of any sort. Any ideas?
 
A

Alf P. Steinbach

* "Some Clown said:
Greetings - I'm sure there's another place to ask this, but I'm not sure
what it is... so I'll be brief. I'd like to be pointed to somewhere (web,
book, whatever) where I can learn how to access a database from C++ using
SQL (I'm assuming this would be best) such as the tables and queries in an
existing Access database. I'd like to do this all via command-line without
having to use a GUI of any sort. Any ideas?

There's no standard C++ database interface.

AFAIK there's no database interface in the Boost library either.

So you'll have to use an interface specific to some database technology, and
for that, use Google to find what you're looking for.
 
J

Julie

Clown, not the right place. There are a lot of microsoft.public.programming.*
newsgroups, hunt around there.

However, in answer to your question, you will probably want to use MFC in a
console application. With an MFC app, you can use the ClassWizard to connect
to the database and automatically generate a wrapper class around your
table(s). Once you get the hang of it, it is a piece of cake, and simple to
manage through the ClassWizard. Refer to the online documentation for
CRecordset and associated classes for details.

Good luck.
 
D

db

Greetings - I'm sure there's another place to ask this, but I'm not
sure what it is... so I'll be brief. I'd like to be pointed to
somewhere (web, book, whatever) where I can learn how to access a
database from C++ using SQL (I'm assuming this would be best) such as
the tables and queries in an existing Access database. I'd like to do
this all via command-line without having to use a GUI of any sort.
Any ideas?

http://sourceforge.net/projects/dbconnect/ or
www.wxwindows.org

br
db
 
J

Jeff Schwab

Some said:
Greetings - I'm sure there's another place to ask this, but I'm not sure
what it is... so I'll be brief. I'd like to be pointed to somewhere (web,
book, whatever) where I can learn how to access a database from C++ using
SQL (I'm assuming this would be best) such as the tables and queries in an
existing Access database. I'd like to do this all via command-line without
having to use a GUI of any sort. Any ideas?

Have you looked at MySQL++?
 
S

Some Clown

db said:
Who is talking about a GUI?


Because of wxDB.

My apologies. I went to the site initially and couldn't find a reference to
databases anywhere. I finally just googled within the site for 'DB' and got
a few entries, mostly API documentation buried in the site. Looks like a
good system, but for now I'm just going with MFC since I'm targeting a MS
Jet database anyhow.

I bookmarked the wxwidgets page though, for future reference and use. :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,164
Messages
2,570,901
Members
47,439
Latest member
elif2sghost

Latest Threads

Top