[unixODBC-support] HELP

Lizarazu Hernando, Juncal juncal.lizarazu at ikusi.com
Tue Feb 8 16:09:12 GMT 2011


Hi, now you get unixODBC 32 bits unicode but it is impossible the connection to the database. Are we doing anything wrong??

 

Here the program source:

 

#define SQL_WCHART_CONVERT

#include <sql.h>

#include <sqlext.h>

#include <sqlucode.h>

#include <wchar.h>

#include <stdio.h>

 

HENV henv;

HDBC hdbc;

 

int main (int argc, wchar_t *argv[])

{

  HSTMT hstmt=0;

  SQLWCHAR dsn[254];

 

 wprintf(L"longitud wchar_t<%d>  longitud SQLWCHAR<%d>\n",

                       sizeof(wchar_t),sizeof(SQLWCHAR));   fflush(stdout);

 SQLAllocEnv(&henv);

 SQLAllocConnect(henv, &hdbc);

 SQLSetConnectAttr(hdbc,SQL_ATTR_ANSI_APP,

       (SQLPOINTER)SQL_AA_FALSE,SQL_IS_INTEGER);

 wcscpy(dsn,L"DSN=mysqlesip;");

 wprintf(L"traza dato: <%S>\n",dsn); fflush(stdout);

 SQLDriverConnectW(hdbc,NULL,dsn,SQL_NTS,NULL,0,NULL,

                  SQL_DRIVER_NOPROMPT);

 ........

 

}

 

Here the result of this source:

 

longitud wchar_t<4>  longitud SQLWCHAR<4>

dsn: <DSN=mysqlesip;>

Error de STATEMENT ODBC 0 SQLSTATE=IM002 Msg=[unixODBC][Driver Manager]Data source name not found, and no default driver specified

 

And here the log from the ODBC:

 

                        Environment = 0x8b96008

[ODBC][31615][SQLAllocHandle.c][345]

                Entry:

                        Handle Type = 2

                        Input Handle = 0x8b96008

[ODBC][31615][SQLAllocHandle.c][463]

                Exit:[SQL_SUCCESS]

                        Output Handle = 0x8b965f0

[ODBC][31615][SQLSetConnectAttr.c][318]

                Entry:

                        Connection = 0x8b965f0

                        Attribute = 115

                        Value = (nil)

                        StrLen = -6

[ODBC][31615][SQLSetConnectAttr.c][500]

                Exit:[SQL_SUCCESS]

[ODBC][31615][SQLDriverConnectW.c][246]

                Entry:

                        Connection = 0x8b965f0

                        Window Hdl = (nil)

                        Str In = [D][length = 1 (SQL_NTS)]     HERE THE PROBLEM, WHY???

                        Str Out = (nil)

                        Str Out Max = 0

                        Str Out Ptr = (nil)

                        Completion = 0

[ODBC][31615][SQLDriverConnectW.c][433]Error: IM002

[ODBC][31615][SQLError.c][424]

                Entry:

                        Connection = 0x8b965f0

                        SQLState = 0xbfd97302

                        Native = 0xbfd97514

                        Message Text = 0xbfd97312

                        Buffer Length = 511

                        Text Len Ptr = 0xbfd97512

[ODBC][31615][SQLError.c][461]

                Exit:[SQL_SUCCESS]

                        SQLState = IM002

                        Native = 0xbfd97514 -> 0

                        Message Text = [[unixODBC][Driver Manager]Data source name not found, and no default driver specified]

[ODBC][31615][SQLError.c][424]

                Entry:

                        Connection = 0x8b965f0

                        SQLState = 0xbfd97302

                        Native = 0xbfd97514

                        Message Text = 0xbfd97312

                        Buffer Length = 511

                        Text Len Ptr = 0xbfd97512

[ODBC][31615][SQLError.c][461]

                Exit:[SQL_NO_DATA]

[ODBC][31615][SQLError.c][424]

                Entry:

                        Connection = 0x8b965f0

                        SQLState = 0xbfd97302

                        Native = 0xbfd97514

                        Message Text = 0xbfd97312

                        Buffer Length = 511

                        Text Len Ptr = 0xbfd97512

[ODBC][31615][SQLError.c][461]

                Exit:[SQL_NO_DATA]

[ODBC][31615][SQLError.c][504]

                ...............

 

Thanks in advance.

Regards,

 

Juncal.

________________________________

De: unixodbc-support-bounces at mailman.unixodbc.org [mailto:unixodbc-support-bounces at mailman.unixodbc.org] En nombre de Nick Gorham
Enviado el: miércoles, 02 de febrero de 2011 12:26
Para: Support for the unixODBC project
Asunto: Re: [unixODBC-support] HELP

 

On 02/02/11 10:43, Lizarazu Hernando, Juncal wrote: 

Hi,

 

            How can we built the driver manager with SQL_WCHAR_CONVERT? Could you give us the instructions?

 

Thanks in advance.

Juncal.

export CFLAGS=-DSQL_WCHAR_CONVERT
./configure
make clean
make

-- 
Nick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20110208/cded0248/attachment-0001.html>


More information about the unixODBC-support mailing list