databaselayer ODBC Unicode

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
borr_1
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Wed Mar 07, 2007 8:10 am
Location: Russia, Shakhty

databaselayer ODBC Unicode

Post by borr_1 »

I use a db with ODBC and Unicode on the WinXP (build as mingw32-make -f makefile.gcc odbc WX_SHARED=1 WX_MONOLITHIC=1 WX_UNICODE=1 WX_DEBUG=1 ). And then there are problems
1. OdbcDatabaseLayer.cpp can not connect to the DB using a connection string (m_strConnection). To need to fix the function Open () on

Code: Select all

bool OdbcDatabaseLayer::Open( )
...
#ifdef wxUSE_UNICODE
     wxCharBuffer connectionCharBuffer = ConvertToUnicodeStream(m_strConnection);
#else
     void* connectionCharBuffer = (void*)m_strConnection.c_str();
#endif

from

void* connectionCharBuffer = (void*)m_strConnection.c_str();
2 can not read the text of the error in non-English locale, must change

Code: Select all

void OdbcDatabaseLayer::InterpretErrorCodes( long nCode, void* stmth_ptr )
...
SetErrorMessage(ConvertFromUnicodeStream((char*)strBuffer));
    //SetErrorMessage(wxString((wxChar*)strBuffer));

Code: Select all

void OdbcPreparedStatement::InterpretErrorCodes( long nCode, SQLHSTMT stmth_ptr )
...
SetErrorMessage(ConvertFromUnicodeStream((char*)strBuffer));
    //SetErrorMessage(wxString((wxChar*)strBuffer));
WinXP SP3, wx-2.8.10, MinGW-4.4.1, gdb-7.1.2, eclipse
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Hi,

you may have missed this, but wxODBC is no more part of wxWidgets; as of wxWidgets 2.9.x, wxODBC was removed. The reason is that wxODBC was old, unmaintained and buggy. So you might want to spend your time on something else :)
"Keyboard not detected. Press F1 to continue"
-- Windows
borr_1
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Wed Mar 07, 2007 8:10 am
Location: Russia, Shakhty

Post by borr_1 »

I'm talking about databaselayer
WinXP SP3, wx-2.8.10, MinGW-4.4.1, gdb-7.1.2, eclipse
Post Reply