create a c++ based program using mysql odbc.

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

    #1

    create a c++ based program using mysql odbc.

    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?

  • Aggro

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

    xiaotom wrote:[color=blue]
    > I want my software to be independant of operation system and databases.[/color]

    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:


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

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

    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:
    The IDE with all the features you need, having a consistent look, feel and operation across platforms.


    # 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:

    Comment

    • xiaotom

      #3
      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.

      Comment

      Working...