Page 1 of 1

Connecting tio Mysql with wxDBA

Posted: Sat Apr 04, 2009 9:50 pm
by c__chp
Is there someone who can give me with a small example which connect to mysql using wxDBA and map some fields.

Many regards
Nico Heiligers

Re: Connecting tio Mysql with wxDBA

Posted: Mon Feb 27, 2012 6:54 pm
by pkuriakose
Hi Nico,

Did you get this working?

Thx

Re: Connecting tio Mysql with wxDBA

Posted: Fri Feb 08, 2013 11:55 am
by maxbld
Hi,

I've done that using the ODBC pluging:

Code: Select all

#include <dba/dba.h>
    try {
        dba::SQLArchive ar;
        ar.open("dbaodbc", "DSN=<your_DSN_name");
        std::string strval;
        int intval;
        std::auto_ptr<dba::DbResult> res(
            ar.getIStream().sendQuery(dba::SQL("SELECT ID, Type FROM Table").into(intval).into(strval))
        );
        while(res->fetchRow()) {
            itoa(intval, value, 10);
            Result += (std::string)value + " " + strval + "\r\n";
        };
        wxMessageBox(Result, "Results", wxOK, parent);
    } catch (const dba::SQLException& pEx) {
        wxMessageBox(pEx.what(), "SQL Error:", wxOK, parent);
    } catch (const dba::Exception& pEx) {
        wxMessageBox(pEx.what(), "Error:", wxOK, parent);
    };
I'm on Win7 64bits, but I'm expecting it to work the same on Linux with iODBC. I'm due to test that sooner or later, but please tell me should you test it on Linux.

BR,
Max.