create a c++ based program using mysql odbc.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I want my software to be independant of operation system and databases.

That's why I want to use odbc, and don't want to use MFC.
Here I have some questions to ask:
1. On unix (like sun solaris), does there exists any kind of midware
like odbc?
2. I search on the internet, and find most of the examples are based on

PHP. Is there any c++ examples?
3.Once I chose odbc, does that mean that whatever kind of database I
would use later, I don't have to change my source code?
4. now I program on window xp platform. If I use odbc, when impliment
my program to a unix platform, do i have to rewrite my code?

 I just started this project, and I'm a newbie.  The problems may be a
little bit of stupid.
Can you guys give me some information about this topic?

Re: create a c++ based program using mysql odbc.

xiaotom wrote:
Quoted text here. Click to load it

I would do this with wxWidgets. It is a cross-platform library, which
allows you to build native looking GUI (when compiled on Windows, it
looks like a Windows program, when compiled on Linux, it looks like a
Linux program etc.) and use databases via ODBC and a lot more: /

Quoted text here. Click to load it

No, it doesn't guarantee it. The reason for this is that even if you
write your queries using ANSI SQL, there are still some databases that
don't fully support it. The less functions you use and the more basic
queries you write the better are changes that no changes are required.
But using ODBC is pretty much best you can do for this purpose.

Quoted text here. Click to load it

If you use wxWidgets or other cross-platform library and no external
single platform functions, no. If you use MFC or other single platform
library, then yes. But some attention should be put for the compiler
also, as some compilers allow you to write code that is not portable and
it will give you some trouble when trying to compile with different
compiler. Gcc is propably most used cross-platform compiler.

If you deside to use wxWidgets with gcc it might be easier to use some
IDE, which has wxWidgets library and the compiler with it. Some
alternatives are:

# Quite mature, Freeware, not open source, has basic features and some
minor bugs. But server often "Bandwidth Limit Exceeded" state: /

# Quite mature, open source, but comes currently with quite old version
of wxWidgets. But you can compile the wxWidgets by yourself if you so
deside: /

# Young project, open source, doesn't have debugger and lacks on some
other features also, but has latest version of wxWidgets library. Only
for Windows currently: /

Re: create a c++ based program using mysql odbc.

Wow, what a reply. it really helps! Facing lots of programming
technologies, i was overwhelmed. Thank you for these good advices.
I now decide to choose odbc-oriented program. As regards to the GUI
library, I will choose one from  QT and wxwidgets.
Now I want to get the database ready. So it will be my next step work.

Site Timeline